1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
tia_tia [17]
3 years ago
7

Here we have a program which is calling the subtract function to calculate the difference between two numbers. The value from th

e subtract function is being stored in a variable called answer. Then answer is being displayed.
Code is not executing as expected. Instead of seeing the answer, we are seeing the word "None."
Modify the code within the subtract function so the value for solution is returned when the function is called. When you are finished, the output should Desired Output.

# Define the subtraction function
def subtraction(minuend, subtrahend):
solution = minuend-subtrahend
print(minuend,"minus",subtrahend,"equals",solution)

# Call the subtraction function
subtraction(4, 10)

desired output:

10 minus 4 equals 6
Computers and Technology
1 answer:
statuscvo [17]3 years ago
8 0

Answer:

See explanation

Explanation:

Given

The above program that subtracts two numbers and returns the result

Required

Modify the source code to run perfectly

When the given program is tested, it displays

<em>4 minus 10 equals -6 </em>

<em></em>

<em>Which is different from the expected output of</em>

<em>10 minus 4 equals 6 </em>

<em></em>

Modify

<em>solution = minuend-subtrahend </em>

<em>to</em>

<em>solution = subtrahend  - minuend</em>

<em></em>

And that does it.

You might be interested in
Programs which were typically reserved for college-level classes such as computer animation and CAD programs are now being appli
Irina-Kira [14]
Answer: I think C


Step by step explanation:
8 0
3 years ago
MICR is an input or output devices
Nataly [62]

Explanation:

If a device is putting data into the computer in the form of text, sound, images, button presses etc. then it is an input device, if the device is outputting things from the computer such as sound, movement, printing, images etc., then it is an output device. ... Therefore it is an input device.

8 0
3 years ago
Select the correct answer.
ch4aika [34]

Answer: A. phones and computers

Explanation:

A tablet, is referred to as a mobile computing device which utilizes the touchscreen as the main input device that it has.

Tablets are usually bigger than a mobile phone but smaller than a computer. You can perform thesame function that you can do on your mobile phone or the computer on the tablet.

One can surf the net, play games and watch videos on the tablet.

7 0
3 years ago
Which one of the following is the correct code snippet for calculating the largest value in an integer array list aList?
vodka [1.7K]

Answer:

Option a.  int max = aList.get(0); for (int count = 1; count < aList.size(); count++) { if (aList.get(count) > max) { max = aList.get(count); } }

is the correct code snippet.

Explanation:

Following is given the explanation for the code snippet to find largest value in an integer array list aList.

  1. From the array list aList, very first element having index 0 will be stored in the variable max (having data type int).
  2. By using for starting from count =1 to count = size of array (aList), we will compare each element of the array with first element of the array.
  3. If any of the checked element get greater from the first element, it gets replaced in the variable max and the count is increased by 1 so that the next element may be checked.
  4. When the loop will end, the variable max will have the greatest value from the array aList.

i hope it will help you!

7 0
3 years ago
Read 2 more answers
Supervisor: You will need to consolidate your trouble tickets
liubo4ka [24]
Wheres the rest???????????????????
7 0
3 years ago
Other questions:
  • If a ≤m b and b is regular, does that imply that a is a regular language? why or why not?
    6·1 answer
  • How do i end my current plan that i never signed up for, the basic one it charged me $24
    11·2 answers
  • What's a good drawing tablet?
    12·2 answers
  • Search the web to discover the 10 most common user-selected passwords, and store them in an array. Design a program that prompts
    7·1 answer
  • Describe the application of computer system in our daily life​
    13·1 answer
  • A Variable can only hold numbers<br><br> True<br><br> False
    15·2 answers
  • System software includes all of the following except
    10·1 answer
  • Does CLAIRE https://claire-ai.org/vision/ considered a representative of Roy Rotwell's Fifth Generation of innovation?
    7·1 answer
  • Which of these would make text on a slide difficult to read?
    7·1 answer
  • Implement one array of the English alphabet (26 characters). a) Create a function, getLetters() to cast and generate the array.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!