Making a purchase


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


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

just change the () to,

total= total+prices[item]


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