subject

The program continuously prompts the user for an integer until the user enters 0. the program then passes the value to a function (sums) that computes the sum of all the whole numbers from 1 up to and including the entered number. next, the program passes the value to another function (products) that computes the product of all the whole numbers up to and including the entered number.

the source code file provided for this lab includes the necessary input statement. comments are included in the file to you write the remainder of the program.

instructions

make sure the file sumandproduct. py is selected and open.
write the python statements as indicated by the comments. remember to output the sum and product to the console.
execute the program by clicking the "run code" button at the bottom of the screen.

"""
sumandproduct. py - this program computes sums and products.
input: interactive.
output: computed sum and product.
"""
# write sums() function here.
# write products() function here.
numberstring = input("enter a positive integer or 0 to quit: ")
number = int(numberstring)
while number ! = 0:
# call sums() function here.
# call products() function here.
numberstring = input("enter a positive integer or 0 to quit: ")
number = int(numberstring)

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:30
To increase sales, robert sends out a newsletter to his customers each month, letting them know about new products and ways in which to use them. in order to protect his customers' privacy, he uses this field when addressing his e-mail. attach bcc forward to
Answers: 2
question
Computers and Technology, 23.06.2019 22:00
Technician a says engine assemblies can be mounted longitudinally in a chassis. technician b says engine assemblies can be mounted transversely in a chassis. who is correct?
Answers: 2
question
Computers and Technology, 24.06.2019 10:00
(, urgent need): how do i change my username
Answers: 1
question
Computers and Technology, 24.06.2019 14:30
Two students are discussing electricity that has a frequency of 60 hz. student a says that this type of electricity is referred to as ac. student b says that in this type of electricity, the electrons flow in only one direction. which of the following statements is correct? a. only student a is correct b. only student b is correct c. both of the two students are correct d. neither of the two students is correct
Answers: 1
You know the right answer?
The program continuously prompts the user for an integer until the user enters 0. the program then p...
Questions
question
Health, 14.04.2021 01:30
question
Mathematics, 14.04.2021 01:30
question
Mathematics, 14.04.2021 01:30
Questions on the website: 13722363