total = 0 count = 0 num = input("Enter a number (or 'stop' to stop): ") while num != 'stop': num = float(num) total += num #accumulator variable count += 1 num = input("Enter a number (or 'stop' to stop): ") print("count = ", count) if count == 0: print("No numbers entered, so no average.") else: avg = total / count print("The average of the numbers you entered is:", avg)