Question: (( in python )) Exercise # 2: Write a loop that reads numbers from the user and sum them. The loop continues till a negative
(( in python ))
Exercise # 2: Write a loop that reads numbers from the user and sum them. The loop continues till a negative number is entered. Your program then prints the result. The following are sample runs of the program. Sample run 1: Enter a positive number: (or a negative value to finish):5 Enter a positive number: (or a negative value to finish):2 Enter a positive number: (or a negative value to finish):4 Enter a positive number: (or a negative value to finish):-5 Sum = 11,0 Sample run 2: Enter a positive number: (or a negative value to finish).-8 No positive number was entered
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
