I really need help on this. Trying to create a code that determines the average temperature for an inputted amount of days. I have the input statement correct and converted to int. However, in the loop, I need it to ask the user each time
What temp was it on day X, with X being the the first day and it repeating and increasing the value each time it loops. Please help me anyone.
Here is the code below:
#Determine average temperature
days = input("How many days are you entering temperatures for:")
days = int(days)
sum = 0
for i in range(days):
temperature = input("What temp was it on day?")
temperature= int(temperature)
sum = sum + temperature
average_temperature = sum/int(days)
print("Average temperature:", average_temperature)
i. Just use that.temperature = input(f"What temp was it on day {i+1}?")