Learn to code with step-by-step lessons. A place for students to work through programming fundamentals and build skills.
One possible program:
total = 0.0
while True:
print("1. Sandwich $6 2. Soup $4 3. Drink $2 0. Done")
choice = int(input("Choice: "))
if choice == 0:
break
if choice == 1:
total += 6
elif choice == 2:
total += 4
elif choice == 3:
total += 2
else:
print("Invalid choice")
print("Your total is $" + str(round(total, 2)))