# average.py # # Find the average of number # input by the user. # # First ask for how many, # then input one number at a time. # # in python class | Sep 6 2018 print("-- average --") how_many = int(input("How many numbers? ")) total = 0.0 for i in range(how_many): prompt = "number " + str(i+1) + " : " number = float(input(prompt)) total = total + number average = total / how_many print("The average is ", average, ".")