x=input("Enter a number: ") while str.lower(x) == "x": x=input("Enter a number: ") a=[] a.append(int(x)) while str.lower(x)!="x": x=input("Enter a number: ") if str.lower(x) == "x": break a.append(int(x)) print("Total:", sum(a))