Stocking Out


#1

def compute_bill(food):
total=0
for item in food:
if stock[item]>0:
total+=prices[item]
stock[item]-=1
return total

print compute_bill(shopping_list)

This should be working but I don't understand why codecademy's python interpreter is giving the wrong response.


#2

Hello, @obsaa!
In fact your code is correct, I'd suggest you to refresh the page and try again or even change browsers.
There are times our interpreter, if I can call it like this, bugs and makes you something with your code is wrong when everything is okay.

Best regards,
g4be