Respuesta :
Answer:
The program is attached, one file is using a fuction and one doing same calculations without a fuction
Explanation:
Please take a look to the files, below is a copy:
months=['january','february','march','april','may','june','july','august','september', 'october','november','december']
monthly_rainfall=[]
for month in months:
parsed=False
while not parsed: #This will keep prompting the user for input until parsed is True which will only happen if there was no exception.
try:
rainfall=float(input("Enter rainfall in inches for the month {}: ".format(month)))
parsed=True
except ValueError:
print('Your input is invalid')
monthly_rainfall.append(rainfall)
print("Total amount of rainfall:{}".format( sum(monthly_rainfall)))
print("Average monthly rainfall:{}".format( sum(monthly_rainfall)/len(monthly_rainfall)))
print("Highest amount of rainfall:{}".format( max(monthly_rainfall)))
print("Lowest amount of rainfall:{}".format( max(monthly_rainfall)))


The program is an illustration of loops
The program in Python, where comments are used to explain each line is as follows:
#This initializes all months of the year
months=['January','February','March','April','May','June','July','August','September', 'October','November','December']
#This initializes a list for the amount of rainfall each month
monthly_rainfall=[]
#The following iteration gets input for the amount of rainfall each month, and appends it to the list
for month in months:
rainfall=float(input("{}: ".format(month)))
monthly_rainfall.append(rainfall)
#The next four lines print the required outputs
print("Total : %.2f" % ( sum(monthly_rainfall)))
print("Average : %.2f" % ( sum(monthly_rainfall)/len(monthly_rainfall)))
print("Highest : %.2f" % ( max(monthly_rainfall)))
print("Lowest : %.2f" % ( min(monthly_rainfall)))
Read more about loops at:
https://brainly.com/question/14284157