subject

Write a Python 3 program that prompts the user for 3 postive numbers (or zero) and then adds them together. If the user enters a negative number, the program should reprompt them until they enter a postive number. Divide your program into two functions: prompt_number - Prompts for a number, and keeps re-prompting as long as it is negative. Then, returns the number. compute_sum - Accepts 3 numbers, adds them together and returns the sum. main - Calls the prompt_number function 3 times, saves the return value into three different variables, then passes those 3 variables to the compute_sum function. Finally, saves the result of compute_sum into a variable and displays it.

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 11:00, lexhorton2002
The great length of north america causes the climate to be varied. true false
Answers: 2
image
Computers and Technology, 23.06.2019 00:00, eguzmandpandoracom
How do we use the sumif formula (when dealing with different formats) ?
Answers: 1
image
Computers and Technology, 23.06.2019 22:50, christingle2004
What is an rss reader used for? for creating a user account on a social new site
Answers: 2
image
Computers and Technology, 24.06.2019 00:30, Auttyrain3929
Afiling system in which an intermediary source of reference, such as a file card, must be consulted to locate specific files is called a(n) system. a. shelf filing b. direct filing c. indirect filing d. shingling
Answers: 1
You know the right answer?
Write a Python 3 program that prompts the user for 3 postive numbers (or zero) and then adds them to...

Questions in other subjects: