number = 0 array = [] total = 0 while number != 'X': array.append(number) number = input("Enter a number: ") for i in array: total += int(i) print("Total:", total) print("Average:", total / (len(array) - 1))