Making A Purchase


#1


https://www.codecademy.com/courses/python-beginner-en-IZ9Ra/2/2?curriculum_id=4f89dab3d788890003000096

Making a Purchase

Write your code below!

def compute_bill(food):
total = 0
for item in food:

    total = total + prices[key]

return total

this is the error which i encounter


"Oops, try again. compute_bill(['banana', 'apple', 'orange', 'pear']) returned 8 instead of 10.5"


#2

Did you mean to write,

prices[item]

?


#3

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