Question: Write a python program with a loop that asks the user to enter a series of positive numbers. The user should enter a negative number

Write a python program with a loop that asks the user to enter a series of positive numbers. The user should enter a negative number to signal the end of the series. After all the positive numbers have been entered, the program should display their sum.
Input:
1.1
2.2
3.3
4.4
5.5
6.6
7.7
8.8
9.9
0
Expected output:
Enter a positive number (negative to quit):
Enter a positive number (negative to quit):
Enter a positive number (negative to quit):
Enter a positive number (negative to quit):
Enter a positive number (negative to quit):
Enter a positive number (negative to quit):
Enter a positive number (negative to quit):
Enter a positive number (negative to quit):
Enter a positive number (negative to quit):
Enter a positive number (negative to quit):
Total =49.50

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 Databases Questions!