list = [] num = " " total = 0 while num != "x" : num = input("enter a number ") if num != "x" : num = int(num) total = total + num list.append(num) print("total: ", total) print("Average: ", sum(list) / len(list))