# # Average the values entered by the user. A blank line will be used to mark # the end of input. # # # Initialize count and total to 0. # count = 0 total = 0 # # Read the first value from the user. # line = input("Enter a number (blank line to quit): ") # # While the value entered by the user is not a blank line... # while line != "": # # Convert the value entered by the user into a number # num = float(line) # # Add the current value to the total so far. # total = total + num # # Count that another value was added to the total. # count = count + 1 # # Read the next value from the user. # line = input("Enter a number (blank line to quit): ") if count > 0: # # Compute and display the average. # print("The average of those values is", total / count) else: # Report that the average could not be displayed. print("No values were entered, so the average could not be displayed.")