total= 0 count= 0 while True: user_input= input("Enter a number use X to finish: ") if user_input.upper() == 'X': break try: number= float(user_input) total += number count += 1 except ValueError: print("Please enter a proper number or X to finish.") if count > 0: average = total / count print(f"\nTotal: {total}") print(f"Average: {average:.1f}") else: print("No numbers entered.")