Shopping shortfall
Write shortfall(needed, have) that takes two lists of item names, one
listing what a recipe needs (with repeats for quantities) and one listing
what is in the kitchen, and returns a dictionary of what to buy: each
missing item with how many more are needed. Items that are fully covered
do not appear.
shortfall(["egg", "egg", "egg", "milk"], ["egg", "butter"]) -> {"egg": 2, "milk": 1}
shortfall(["egg"], ["egg", "egg"]) -> {}
The point is to practise Counter subtraction.
def shortfall(needed, have):
...