First time user here and newbie at programming. Ask the user how many days that they collected gems. A loop you write should loop how many days the user enters. If the user enters 5 days, then the loop should loop 5 times to collect the data from each day.
So, each loop iteration represents a day. In each loop iteration, ask the user how many gems they collected that day. After the loop finishes gathering the data for each day, calculate the total and average gems collected. Display the average as a float value.
Sample input/output (your output should match exactly): How many days did you collect gems? 5
Enter the number of gems collected on day 1: 5 Enter the number of gems collected on day 2: 4 Enter the number of gems collected on day 3: 3 Enter the number of gems collected on day 4: 2 Enter the number of gems collected on day 5: 1
Total gems collected: 15 Average gems collected per day: 3.00
I believe I have a lot of it right, but there is something wrong somewhere and I cannot figure it out.
days = int(input("How many days did you collect gems?"))
total = 0
for total in range(1, days + 1):
gems = int(input("Enter the number of gems collected on day {0}:".format(total)))
total_gems = total + days + days
print("Total gems collected:","{0:.0f}".format(total_gems))
average_gems = float(total_gems / days)
print("Average gems collected per day:","{0:.2f}".format(average_gems))