Solution :
def year):
inches [tex]$=[]$[/tex]
[tex]$\text{count} =0$[/tex]
for range(year):
for j in range:
print("Enter the for the month in format(r))
count1
last = float(())
inches(last)
totalRainfall sum(inches)
totalMonths [tex]$=$[/tex] count
return [tex]$\text{totalMonths,totalRainfall}$[/tex]
if __name__ '__main__':
year = int(input("Enter the [tex]$\text{number}$[/tex] of years ([tex]$\text{Greater than 0}$[/tex]):\n"))
print("For [tex]$\text{year",year,":")}$[/tex]
while year :
year = int(("Enter of years ():\n"))
print("For [tex]$\{\}$[/tex] months"[tex]$.\text{format}$[/tex](totalMonths))
print("Total rainfall: ",[tex]$\text{totalRainfall}$[/tex])
print("Average monthly [tex]$\text{rainfall:}$[/tex]",[tex]$\text{totalRainfall/totalMonths}$[/tex])