I am pretty new to Python and am practicing with codeacademy, am getting a strange error message with below function. I dont understand as it looks logically and syntactically correct to me, can anyone see the issue?
def compute_bill(food):
total = 0
for item in food:
total = total + item
return total
Oops, try again.
compute_bill(['apple'])
resulted in a
TypeError: unsupported operand type(s) for +: 'int' and 'str'
0 + 'apple'is not a meaningful operation in Python. You can only add numbers or concatenate strings, not add strings to numbers.apple's price ?