The laundry's price list is {item: price}, and you hand over a bag of clothes bag. Write laundry_bill(prices, bag) to add up the price of everything in the bag; anything not on the price list (they don't wash it) is skipped and costs nothing.
laundry_bill({"shirt": 5, "coat": 12}, ["shirt", "coat", "shirt"])→22laundry_bill({"shirt": 5}, ["sofa"])→0def laundry_bill(prices, bag):
total = 0
for item in bag:
try:
# your code here: look up this item's price and add it to total
pass
except KeyError:
pass
return total
Run tries the examples. When they look right, Submit.