For Questions 1-4, consider the following code: def mystery1(x): return x + 2 def mystery2(a, b = 7): return a + b #MAIN n = int(input("Enter a number:")) ans = mystery1(n) * 2 + mystery2 (n * 3) print(ans)
What is the output when the user enters -4?
What is the output when the user enters 3?
What is the output when the user enters -2?
What is the output when the user enters 9?

Answers

Answer 1

Answer:

What is the output when the user enters -4?

-9

What is the output when the user enters 3?

26

What is the output when the user enters -2?

1

What is the output when the user enters 9?

56

Explanation: Just did it and got all correct. Hope it helps!!


Related Questions

PLEASE ANSWER
Select the correct answer.

What test was developed to filter humanlike artificial intelligence?

Answers

Answer:

Turing test is the answer

Use the drop-down menus to complete statements about the Outlook filter option and Clutter folder.

The Filter dialog box can be accessed under the View tab and the ______
button.

The Clutter folder uses _______
filtering to divert low-priority messages.

Answers

Answer:

1. view settings

2. smart

Explanation:

In the Outlook filter option and Clutter folder, the Filter dialog box can be accessed under the View tab and the view settings button.

What is Microsoft Outlook?

Microsoft Outlook can be defined as an e-mail and task management software application which is designed and developed by Microsoft Inc., so as to enable users send electronic messages, schedule and plan their work activities.

In the Outlook filter option and Clutter folder, the Filter dialog box can be accessed under the View tab and the view settings button. Also, the Clutter folder uses Smart filtering to divert low-priority messages.

Read more on Microsoft Outlook here: https://brainly.com/question/1538272

#SPJ2

what number will be output by the console.log command on line 5?

Answers

Answer:

16

Explanation:

If you follow the line of code and add 1, 2, and then 3, 10 + 1 + 2 + 3 = 16.

Please, need Brailliest. if you need any further assistance let me know.

You are in the process of configuring an iSCSI storage area network (SAN) for your network.
You want to configure a Windows Server 2016 system to connect to an iSCSI target defined on a different server system. You also need to define iSCSI security settings, including CHAP and IPsec.
Which tool should you use?
A. iSCSI under File and Storage Services in Server Manager
B. iSCSI Initiator
C. Multipath I/O
D. Internet Storage Name Service

Answers

Answer: B. iSCSI Initiator

Explanation:

Based on the above scenario discussed, the tool that'll be used is the iSCSI Initiator. It should be noted that it typically functions as the iSCSI client.

The Internet Small Computer System Interface (iSCSI) initiator can be used to configure an iSCSI storage area network (SAN) for the network. Through the iSCSI Initiator, commands can be sent over an IP network. When one wants to connect to a particular iSCSI target, the iSCSI Initiator can be used.

Dolphin TecX is a new tech company that just issued smart watches to its employees. But there is a problem: Getting the watches to receive company email has not been easy. What problem has the company just experienced that is one of the biggest problems in networking?
A.Keeping devices protected from virus and security threats
B.Getting hardware and softwarr from different sources to work together.
C.Gettint email programs to work correctly
D.Justifiying the cost of purchasing new technology​

Answers

Answer:

Getting hardware and software from different sources to work together.

Explanation:

Answer: B.Getting hardware and software from different sources to work together.

Select the correct answer. Which number system consists of digits 0 to 9 and letters A to F? octal binary hexadecimal decimal

Answers

Answer:

hexadecimal

represents a radix of 16

python

You need to have some text that will repeat on 50 random images to create memes for your Twitter account. Don’t worry about having any images; just get the text to repeat for a meme that you would create. That would take you a while to do… but luckily you have for loops! Using a for loop, print “Takes one political science class. Knows how to solve the world’s problems.” for your 50 meme images, so 50 times

Answers

for i in range(50):

   print("Takes one political science class. Knows how to solve the world's problems.")

I hope this helps!

What refers to the outline of the necessary components for a project, first given to developers at the beginning of a project and modified through the development cycle?

a
General design document (GDD)
b
Software blueprint (SBP)
c
Architectural structure orders (ASO)
d
Software requirement specifications (SRS)

Answers

Answer:

d

Explanation:

find different between manocots and dicots clarify with example​

Answers

Answer:

hope it's help you..............

In the GO programming language you can't declare a float, it must be a float32 or float64. Why do you think this is done if the data type is not necessary? Why do you think they used float64 instead of double? Think about the lexical analyzer and how it interprets a symbol.

Answers

Answer and Explanation:

a. Go programming language specifies data types and does not allow mixing them up. Therefore instead of just declaring a float variable, one has to be specific and declare either a float32(single precision floating point number) variable or float64(double precision floating point number). Float64 numbers occupy larger spaces and could be slower in some systems but they represent more accurate numbers.

b. Float64 is more accurate and is used by most math libraries. Float64 and double are same thing, although double precision numbers are called float64 in Go, it doesn't affect the lexical analyzer in any way.

If you use microsoft windows, the windows _____ application can automatically update the operating system as well as microsoft programs installed on your computer

Answers

Answer:

Microsoft Windows 10 ... (Windows) If you accidentally delete files from your computer's hard drive, ... Upgrade to remove ads ... (Windows) Applications (or apps) in Windows 10 that you use frequently can be ... the operating system, installed programs, settings, and user files that you can later use to recover your computer.

Explanation:

Answer:

Task Manager?

Explanation:

Who is least likely to be treated with somatropin?
A 3-year-old cow on a dairy farm
A 4-year-old girl with an XO genetic genotype
A 44-year-old boy with chronic renal failure and gronih deficiency
A 10-year-old boy with polydipsia and polyuria​

Answers

A 10-year-old boy with polydipsia and polyuria​ would likely not be treated with somatropin.

This is because somatropin is often used for growth issues and even short bowel syndrome, but from what I could find, nothing about polydipsia or polyuria​.

A 3-year-old cow on a dairy farm could need somatropin, specifically Bovine Somatotropin (bST) to increase milk production or fix growth issues

A 4-year-old girl with an XO genetic genotype would get somatropin because it is used to treat Turner syndrome (Same as XO genetic genotype)

A 44-year-old boy with chronic renal failure and growth deficiency would get somatropin because it is used to treat growth issues even in adults and chronic renal failure

Guess The Song
Trade my 4x4 for a G63, ain't no more free Lil Steve
I gave 'em chance and chance and chance again, I even done told them please

Answers

I think is C tbh sorry if that’s wrong my fault

It is to be   noted thatthe title of the above song is " The Bigger Picture" by Lil B.

What  is the  central idea of "The Bigger Picture" by Lil B?

The core theme explored in the song "The Bigger Picture" by Lil B is the existence of societal injustices and systemic biases that go beyond isolated events or individuals.

The song highlights the importance of finding comprehensive solutions, acknowledging that these issues have endured for generations and demand more than just activism or online movements.

Lil B shares personal experiences with unjust treatment and encourages listeners to grasp the broader perspective, striving for substantial transformations in society.

Learn more about songs at:

https://brainly.com/question/27263334

#SPJ6

You should always be afraid to use the internet

True or false?

Answers

Answer:

false

Explanation:

you should be but in the same time no

Which of the following BEST describes personal responsibility?
1.Provides the basis for your code of ethics
2.Obeying laws that regulate how computers are used
3.Rules that support your personal values
4.How you act even if no one is watching

Answers

Answer:

3.Rules that support your personal values

Explanation:

Jacob has a text file open, and he is typing on the keyboard. What is the best description of how the
changes are being implemented?
The original file is temporarily changed; the changes become permanent when he clicks "save."
O The new version is kept in a special virtual space; the file is only changed when he clicks 'save."
O The information is stored on the clipboard.
O A copy is created with a new filename, which will overwrite the old one when he clicks "save."

Answers

Answer:

The new version is kept in a special virtual space; the file is only changed when he clicks “save.”

Explanation:

I took the test and got it correct.

What charts the cost to the company of the unavailability of information and technology and the cost to the company of recovering from a disaster over time?A. Disaster organizational cost analysisB. Disaster recovery improvementsC. Disaster financial costD. Disaster recovery cost curve

Answers

Answer:

D. Disaster recovery cost curve

Explanation:

Disaster Recovery Cost Curve can be regarded as the chart to the cost of the

unavailability of information and technology as well as the the cost to the company of recovering from a disaster over time. It should be noted that recovery plan is very essential in any organization because it makes response to disaster as well as other emergency that can tamper with information system to be easier as well as minimization of any effect of the disaster on business operations.

Assume a system has a TLB hit ratio of 90%. It requires 15 nanoseconds to access the TLB, and 85 nanoseconds to access main memory. What is the effective memory access time in nanoseconds for this system?

Answers

Answer:

310 ns

Explanation:

Given that

TLB hit ratio = 90%

TLB hit ratio = 90/100

TLB hit ratio = 0.9

Time needed to access TLB = 15 ns

Time needed to access main Memory = 85 ns

Effective memory access time = ?.

The formula for finding the effective memory access time is given by

The effective memory access time = [TLB Hit ratio (main memory access time + required time to access TLB) + [2 * (main memory access time + required time to access TLB)] * (2 - TLB hit ratio)]

On substituting the values given in the question to the equation, we have

The effective memory access time = [0.9 (85 + 15) + [2 * (85 + 15)] * (2 - 0.90)]

The effective memory access time =

[(0.9 * 100) + (2 * 100) * 1.1]

The effective memory access time =

(90 + (200 * 1.1))

The effective memory access time =

90 + 220

The effective memory access time =

310 ns

Complete each sentence to describe features of the VLOOKUP function.
The VLOOKUP function structure begins with =VLOOKUP(
To use the VLOOKUP function, the lookup value should be in the
of the table.

Answers

Answer:

Look Up Value, Table Array, First Column

Explanation:

The VLOOKUP function structure begins with =VLOOKUP(

✔ lookup value

,

✔ table array

…)

To use the VLOOKUP function, the lookup value should be in the

✔ first column

of the table.

What should you consider when looking at houses to buy? A. Location B. Size and condition of the yard C. Size, features, and condition of the house D. All of the above MAKE YOU BRAINELEST

Answers

Answer:

A

Explanation:   Would you like to buy a house in the desert

Answer:

The answer to your question is D. All of the above

Consider the following class which is used to represent a polygon consisting of an arbitrary number of (x, y) points:
class Polygon :
def __init__(self) :
self._x_points = []
self._y_points = []

Answers

Answer:

The init method of the Polygon class defines two attributes 'x' and 'y' which are both lists. To add points to the lists x and y, define the add_point method;

def add_point(self, x, y) :

   self._x_points.append(x)

   self._y_points.append(y)

Explanation:

A class is a blueprint of a data structure. It contains the attributes and methods of the data structure type. Attributes are features of a data structure defined as variables that can be either a class attribute or an attribute of the instance of the class object. A method is just a function defined in a class.

The add_point method in the polygon class accepts two parameters and appends the values to the x and y lists defined in the init method.

Which of the following would a dialogue editor most likely do if an actor makes a lip smacking sound during a dialogue sequence?

A)Use an ADR

B)Review raw footage to layer over the dialogue

C)Use voice over narration

D)Remove it and replace it with another sound

Answers

Answer:

c

Explanation:

If I wanted to include a picture of a dog in my document, I could use
AutoCorrect
SmartArt
WordArt
Online Pictures

Answers

Answer:

Online Pictures

Explanation:

Answer:

Online Pictures

Explanation:

It's not Auto Correct obviously, Word art is with text, and Smart art is formatting or the way it looks

Which is the instance variable in the given code?

public class Person{

public intpid;

private double salary;

public Person (intpersonID){
pid = personID;
}

public void setSalary(double empSal){
salary = empSal;
}

public void printDetails(){
System.out.println("id : " + pid );
System.out.println("salary :" + salary);
}

public static void main(String args[]){
Person P = new Person("P1");
P.setSalary(100);
P.printDetails();
}
}


A. public intpid;
B. private double salary;
C. intpersonID
D. double empSal
E. Person P = new Person("P1");

Answers

Answer:

Person P is a new instance of Persons class

-- located in the main class

You defined a book data type.

class book:
title = ''
author = ''
pages = 0
Which statement creates an instance of your book?


myBook.myBook = book()

myBook = new book()

myBook = book

myBook = book()

Answers

Answer:

myBook = book()

Explanation:

Correct answer edge 2020

Answer:

myBook=book()

Explanation:

took test

Sam is developing a software program in Python and has a question about how to implement a particular feature.
Which use of a resource is most likely to provide Sam with the best results?
joining a Python developer forum and posting a question to the forum to solicit feedback
joining a Python developer forum and following links to technical news sites
reviewing an Introduction to Computer Science textbook
reviewing the computer user manual

Answers

Answer:

The correct answer is:

"joining a Python developer forum and posting a question to the forum to solicit feedback"

Explanation:

Learning a new skill involves a lot of research and study especially learning a new programming language.

The syntax and commands have to be understood first.

Now if Sam has to implement a particular feature, the easiest and less time-consuming way is that he post his query on a Python language forum as there might be better and expert programmer that might help

Hence,

The correct answer is:

"joining a Python developer forum and posting a question to the forum to solicit feedback"

Answer:

D

Explanation:

reviewing the computer user manual

Help it don’t let me click what do I do

Answers

Answer: Try resetting you device, or add a mouse to it.

Explanation:

The method longestStreak is intended to determine the longest substring of consecutive identical characters in the parameter str and print the result.

For example, the call longestStreak("CCAAAAATTT!") should print the result "A 5" because the longest substring of consecutive identical characters is "AAAAA".

Complete the method below. Your implementation should conform to the example above.

public static void longestStreak(String str)

Answers

public class JavaApplication72 {

   public static void longestStreak(String str){

       char prevC = '_';

       String largest = "";

       String txt = "";

       for (int i = 0; i < str.length(); i++){

           char c = str.charAt(i);

           if (c != prevC){

               txt = "";

           }

           txt += c;

           if (txt.length() > largest.length()){

                   largest = txt;

           }

           

           prevC = c;

       }

       System.out.println(largest.charAt(0)+" "+largest.length());

   }

   public static void main(String[] args) {

       longestStreak("CCAAAAATTT!");

   }

   

}

A Method in java is a block of named statements, that can be executed by simply calling it.

The method longestStreak in Java is as follows where comments are used to explain each line is as follows:

public static void longestStreak(String str){

   //This initializes the initial character to an empty character

   char previousChar = ' ';

   //This initializes the current and the longest streak to an empty string

   String largestStreak = "", currentStreak = "";

   //This iterates through the string

   for (int i = 0; i < str.length(); i++){

       //This checks if the current character and the previous character are not the same

       if (str.charAt(i) != previousChar){

           //If yes, the streak is reset

           currentStreak = "";

       }

       //The streak continues here

       currentStreak += str.charAt(i);

       //This checks the length of the longest streak

       if (currentStreak.length() > largestStreak.length()){

           largestStreak = currentStreak;

       }

       //This sets the previous character to the current character

       previousChar = str.charAt(i);

      }

      //This prints the longest streak and its length

      System.out.println(largestStreak.charAt(0)+" "+largestStreak.length());

  }

At the end of the method, the longest streak and its length, are printed.

See attachment for sample run

Read more about similar programs at:

https://brainly.com/question/13464860

IN C++Write a recursive method insertLast(const ItemType& anEntry) to insert anEntry to the end of the Linked List.We can determine how many digits a positive integer has by repeatedly dividing by 10 (without keeping the remainder) until the number is less than 10, consisting of only 1 digit. We add 1 to this value for each time we divided by 10. Write a recursive function numOfDigits(int n) to return the number of digits of an integer n.

Answers

Answer:

#include <iostream>

#include <cstdlib>

int numOfDigits(int n) {

   if (std::abs(n) <= 9) return 1;

   return 1 + numOfDigits(n / 10);

}

int main()

{

   int a[] = { 0, 1, -24, 3456, 12345 };

   for (int n : a)  

       std::cout << n << " has " << numOfDigits(n) << " digits" << std::endl;

}

Explanation:

This is the answer to your second question.

The first question requires some clarification on how the linked list is defined.

Objective: Write a program that will read and parse data from a file, then make use of lists to solve a problem.
Problem: Using python, write a program that will compute the maximum possible profit for a stock trade using historical data on a selection of companies. We would like to find the maximum possible profit that we could have gained, if we had made an ideal investment (if we ever finish that time machine). We must determine the largest increase in value from the purchase date to the sell date, using historical information. We will use the daily low price to purchase and the daily high price to sell a stock. For this assignment, we will use actual freelyavailable stock data stored in .CSV (comma separated values) format from Yahoo finance. A significant part of the exercise is learning to read and parse data from files and to format output.
1. Request the name for the input data file to be used to determine the results. You will have to run your program on all of the data sets to generate the required results. If the program does not exist, print a warning message and allow the user to try again.
2. Read in all the data from the requested file and parse the data; extracting the useful bits into one or more lists.
3. Use the data to determine the largest gain possible in a stock price by comparing Low values as the purchase price and High values as the sale price.
4. Report for each stock symbol (AAPL, AMZN, GOOG, MSFT, and TSLA) the purchase and sale days, the purchase and sale prices, profit per share, and the ratio of the change in value. Enter these results as submission comments in Blackboard.
5. Continue to request file names until the user enters a blank name (empty string), then exit the program.
6. Use good functional style and suitable variable names.
7. In the submission comment, answer the question: If you could travel back in time and invest in one of the five stocks listed, which stock would you pick?
Note: Assume that you must keep stocks for at least one day, no buying and selling on the same day. The data files contain more data than is needed, be sure to use the correct values. Be sure to move the data files into the same folder as your code so that your program can find the data files.
Example Output and Results: Please enter the data file name: BLARG.csv
Error Reading data ...
The file does not exist. Please check the name and try again.
Please enter the data file name: GOOG.csv
Reading data ...
****************************************
The maximum profit is 1045.88 per share
Buy on 2015-01-12 at a price of 486.23
Sell on 2020-02-19 at a price of 1532.11
Change in value ratio: 3.151

Answers

Answer:

import csv

def stock_prof():

   csvfile = input("Enter absolute path to file name")

   while csvfile:

       file = open(csvfile, 'r')

       data = csv.DictReader(file)

       profit_list = [row['High'] - row['Low'] for row in data]

       print(f"The maximum profit is: {max(profit_list)}")

       for row in data:

           print(f"Buy on {row['Data']} at the price of {row['Low']}")

           print(f"Sell on {row['Data']} at the price of {row['High']}")

           print(f"Change in value ratio: {row['High']/row['Low']}")

       csvfile = input("Enter filename: ")

stock_prof()

Explanation:

Assuming the CSV file is in the same directory as the python script, the user inputs the file name and uses the CSV DictReader method to read the file as an ordered dictionary, then the maximum profit is printed as well as the date to buy and sell and the change in value ratio.

Other Questions
If water has a density of 1g/cm will something with a density of 1 float or sink What elements would likely form an ionic bond?a. C & Ob. Mg & Clc. Mg & Cad. Cl & ArWhen electrons are ______________ from one atom to another, we say the bond is ionic.a. transferredb. shared How many electrons does 47Ag+1 have?10747 4846 can someone help me find the y= mx +b of this equation Egyptians used the shadoof forriver transportationbuilding the pyramidsirrigating their fieldsdredging the fieldsThe answer is the 3rd one What does Precambrian Time consist of? Name the three of them. The phases of the Moon are caused by the... The legal idea of nullification, as argued by the Virginia and Kentucky Resolutions, relates togovernment power versus individual power.free speech versus sedition.immigrants rights versus citizens rights.state power versus federal power. Instructions: Find the measure of the indicated angle to thenearest degree What is the price of 1 pound of potatoe? unscramble Gern - ich - schwimme - im Sommer. 2 triangles are shown. The second triangle is rotated 90 degrees to the right. A point is between both triangles.Examine the rotation. Which best describes point D?angle of rotationcenter of rotationimagepre-image map of Central America and the Caribbean countriesUse a reference map in an atlas to label each country and identify its capital city.San SalvadorEl SalvadorJamaicaHaitiManaguaPort of SpainBelizeNassauNicaraguaTrinidad and TobagoKingstonPort-au-PrinceCosta RicaSan JoseThe BahamasBelmopanWILL GIVE BRAINLYEST Identify the order of the eight levels of taxonomy, from least specific (largest) to most specific (smallest), using the drop down menus. A 50 kg pitcher throws a baseball with a mass of 0.15 kg, if the ball is thrown with a positive velocity of 35 m/s, and there is no net force on the system, what is the velocity of the pitcher? Type the chemical name of the compound that contains 1 copper atom, 1 oxygenatom, and 1 hydrogen atom. Is weathering a constructive or deconstructive process? Who is Thomas Sanders and What are the names of all the Sides? Only Fanders will know this Planets A and B have the same size, mass, and direction of travel, but planet A is traveling through space at half the speed of planet B. Which statement correctly explains the weight you would experience on each planet? A. You would weigh less on planet B because it is traveling twice as fast as planet A. B. You would weigh the same on both planets because their masses and the distance to their centers of gravity are the same. O C. You would weigh more on planet B because it is traveling twice as fast as planet A. D. You would weigh the same on both planets because your mass would adjust depending on the planet's speed. WHO SAID THIS? NO LOOKING IT UP!Wake up to reality! Nothing ever goes as planned in this accursed world. The longer you live, the more that youwill realise that the only things that truly exist in this reality are merely pain, suffering and futility. Listen... everywhere you look in this world, whenever there is light there will always be shadows to be found as well. As long as there is a conceptof victors, the vanquished will also exist. The selfish intent of wanting to preserve peace, initiates wars and hatred is born in order to protect love. There are nexuses, casual relationships that cannot be separated. write a statement telling what each infographic is all about.