Orders come in one line, split by commas, like "Latte, muffin, latte", with careless capitals and spaces. menu is a dict (lower-case name → price). Write order_total(menu, order) to return the total; skip anything not on the menu; an empty order is 0.
order_total({"latte": 18, "muffin": 12, "tea": 10}, "Latte, muffin, latte")→48order_total({"latte": 18, "tea": 10}, "TEA, pizza ")→10order_total({"latte": 18}, "")→0def order_total(menu, order):
total = 0
for item in order.split(","):
name = item.strip().lower()
# your code here: if name is on the menu, add its price
pass
return total
Run tries the examples. When they look right, Submit.