The fruit stall keeps its stock in a dict of fruit to count. Write sell(stock, fruit, n): n of fruit were sold, so take them off its count and return the updated dict. fruit is always in the dict.
sell({"apple": 10, "pear": 4}, "apple", 3)→{'apple': 7, 'pear': 4}sell({"apple": 10, "pear": 4}, "pear", 4)→{'apple': 10, 'pear': 0}def sell(stock, fruit, n):
# your code here: take n off the count of fruit
return stock
Run tries the examples. When they look right, Submit.