num = input("Enter a number: ") total = 0 count = 1 while num != "X" : num = int(num) num = (input("Enter a number: ")) if num == "X" : print("Total: ", total) print("Average: ", total/count) total = total+num else: num = int(num) total = total + num count = count+1 if num == "X" : print("Total: ", total) print("Average: ", total/count)