Making a Purchase


#1

def compute_bill(food):
total= 0
for food in prices:
total += food
return total

Oops, try again. compute_bill(['apple']) resulted in a TypeError: unsupported operand type(s) for +=: 'int' and 'str'


#2

What information are you missing?
I suggest carefully reading your error message, it says that you're trying to do something that isn't possible, and by comparing what it says isn't possible to what you have in your code, you can determine what you'll need to change


#3

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