注文は "Latte, muffin, latte" のように、カンマで区切った 1 行で届きます。大文字やスペースはばらばらです。menu は辞書(小文字の名前 → 値段)です。合計を返す order_total(menu, order) を書きましょう。メニューにないものは飛ばし、空の注文は 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()
# ここにコードを書く:name がメニューにあれば値段を足す
pass
return total
実行すると例で試せます。よさそうなら提出しましょう。