12. Stocking out
It adds up to 4 instead of the correct 7.
I expect it to add up. I try using the word item, value and key - none of get the right result. (It seems that the word value should work because that is the exact thing in the dictionary we are being asked to add.)
Replace this line with your code. def compute_bill(food): total = 0 for item in food: if (stock[item] > 0): total += prices[item] stock[item] = stock[item] - 1 return total