← back to unit
Easy
# power tools easy
The Snack Bar Bill
The snack bar's menu maps each snack to its price — total up an order! 🧾
You get the menu as comma-separated item:price pairs, then the order as a list of items (repeats allowed, all on the menu). Print the total cost.
Example:
Input: menu = "cola:3,chips:5,gum:1", order = ["cola", "chips", "cola"]
Output: 11
Looking up each ordered item's price and adding it up: cola (3) + chips (5) + cola (3) = 11.
💡 need a hint?
pt-snack-bar-bill.py🔒 given lines are locked — write your code in between
loading...