12/13 totally stuck


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

error message i get is: calling compute_bill with a list containing 2 apples, 3 pears, 2 oranges and 8 bananas resulted in 44.0 instead of the correct 36.0

im tottaly stumped here i dunno what else 2 say


For starters, always check your indentation to be sure it is correct. We can’t tell right now, but that could cause issues.

Be sure to include a link to the exercise so we are all on the right page and can test your code with the correct SCT.

The error message doesn’t really align with the posted code since there are quantities.


figured it out i missed something out i was ment 2 do like a dummy deff need 2 have a break!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.