Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Rainfall Amounts Create a python program that prompts the user to enter rainfall amounts (in inches) for 12 months of one year. The values must
Rainfall Amounts
Create a python program that prompts the user to enter rainfall amounts (in inches)
for 12 months of one year. The values must be stored into a list.
Using the list you created, your program must print out:
The total rainfall
The average monthly rainfall (Rounded to two decimal places.)
The month with the most rain
The month with the least rain
If the user enters a negative number for a month, keep prompting the user to re-enter a non-negative
value for the month.
Sample Input/Output
Please enter the rainfall amount for month 1: 5
Please enter the rainfall amount for month 2: 4
Please enter the rainfall amount for month 3: 3
Please enter the rainfall amount for month 4: 2
Please enter the rainfall amount for month 5: 1
Please enter the rainfall amount for month 6: 0
Please enter the rainfall amount for month 7: -6
Invalid amount. Try again.
Please enter the rainfall amount for month 7: -2
Invalid amount. Try again.
Please enter the rainfall amount for month 7: 2
Please enter the rainfall amount for month 8: 3
Please enter the rainfall amount for month 9: 4
Please enter the rainfall amount for month 10: 5
Please enter the rainfall amount for month 11: 6
Please enter the rainfall amount for month 12: 7
The total rainfall is 42 inches.
The average monthly rainfall is 3.50 inches.
The month with the most rain was month 12.
The month with the least rain was month 6.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started