Question: Write a program named product.py that reads user input for an integer. Assume the user enters only the positive integer. The program uses a while

Write a program named product.py that reads user input for an integer. Assume the
user enters only the positive integer. The program uses a while loop to repeatedly get this input
until the user enters zero. Once zero is entered, the program exits the loop and prints the product
of all numbers entered excluding the zero.
Example program run (underlined parts indicate what the user enters)
Enter an integer (give 0 to exit): 2
Enter an integer (give 0 to exit): 3
Enter an integer (give 0 to exit): 5
Enter an integer (give 0 to exit): 1
Enter an integer (give 0 to exit): 0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!