我在做一个问题,我需要找到用户输入的总数。但当我这样做时,它只输出最后一个用户输入。这是我得到的。#Ask for the number of days of weather data they have
weather = int(input("How many days of weather data do you have? "))
total=0
x=1
#Ask what the rainfall was for each day
while(x<=weather):
temp_weather = input("What is the rainfall for day " +str(x)+"? ")
x=x+1
#Add the total rainfall output
while(temp_weather>total):
total= total+temp_weather
print("The total rainfall for the period was "+ str(weather))