very new to python and it is also my first programming langue. i have two list one to take in user input for how much rainfall happened each month and the other for the months of the year. i want to output: each month with how much rainfall it had, the total rainfall for the year, the avg rainfall each month, and i want to add the max and min rainfall months. i now how to use max and min command built in and can get it to print but i don't know how to get the associated month to print with it. any help would be amazing.
for clarification: if march was the heaviest rainfall month of the year and it had 10 inches i would like the output to say "March had the highest rainfall of the year with 10 inches"
for clarification: if march was the heaviest rainfall month of the year and it had 10 inches i would like the output to say "March had the highest rainfall of the year with 10 inches"
rainfall = [] months = ['January', 'February', 'March', 'April', 'May', 'June','July', 'August', 'September', 'October', 'November', 'December'] rainfall_year = 0 for x in months: day_rainfall = float(input(f" In {x} what was the rainfall for the month? ")) rainfall.append(day_rainfall) rainfall_year += day_rainfall monthly_rainfall_avg = rainfall_year/12 for x in range(len(months)): print(f'{months[x]}: {rainfall[x]}') print(f'Your total rainfall for the year is {rainfall_year}') print(F'The monthly average rainfall for the year is: {monthly_rainfall_avg}')