numarr = [] while True: num = input("Enter a number: ") if num.lower() == "x": break numarr.append(int(num)) total = sum(numarr) average = total / len(numarr) print("Total:", total) print("Average:", average)