Learn to code with step-by-step lessons. A place for students to work through programming fundamentals and build skills.
One possible program:
menu = {"coffee": 3.5, "muffin": 2.0, "juice": 4.0}
total = 0.0
while True:
item = input("Order item (or 'done'): ").strip().lower()
if item == "done":
break
if item in menu:
total += menu[item]
else:
print("Not on menu")
print("Total: $", round(total, 2))