# Compute the average of a collection of values entered by the user. # The user will enter a blank line to indicate the end of input. # Initialize count and total to 0 count = 0 total = 0 # Read the first value value = input("Enter a number: ") # While the entered value is not a blank line while value != "": # Convert value to a floating point number and add it to total total = total + float(value) # Increase the count of how many values were entered count = count + 1 # Read the next value value = input("Enter another number: ") # Display an appropriate error message if no values were entered if count == 0: print("No values were entered.") else: # Compute the average and display the result average = total / count print("The average of those numbers is", average)