Unit 3 Task 11: Cafe menu order total

Learn to code with step-by-step lessons. A place for students to work through programming fundamentals and build skills.

Unit 3 Task 11 - Cafe menu order total

← Unit 3 tasks - Solution


Prices are in a dictionary: keys are item names (strings), values are prices (floats), e.g. {"coffee": 3.5, "muffin": 2.0, "juice": 4.0}.

Repeatedly ask what item the customer wants until they type done. If the item is on the menu, add its price to a running total. If unknown, print Not on menu and do not add.

Print the final total with two decimal places (you can use round(total, 2)).

Skills: dict lookup, in, accumulation.