Making a purchase


#1




Oops, try again. compute_bill(['apple']) resulted in a TypeError: 'dict' object is not callable


Not sure what this error means.


# Write your code below!
def compute_bill(food):
    total= 0
    for item in food:
        total= total+prices(item)
    return total


#2

In for loops you are required to use brackets [] not parentheses(),

just change the () to,

total= total+prices[item]


#3

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