Question: Python IDLE Create a program to allow the user to enter a sequence of nonnegative numbers. The user ends the list with a negative number.
Python IDLE Create a program to allow the user to enter a sequence of nonnegative numbers. The user ends the list with a negative number. At the end the sum of the nonnegative numbers entered is displayed. The program prints zero if the user provides non-nonnegative numbers. Sample output:
| Enter numbers to sum, negative number ends list:Enter: 2 Enter: 5 Enter: 9 Enter: -1 Sum = 16
|
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
