Making a purchase


#1



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

i dont know what is wrong in my code
Help!!! ( sorry for my bad english )

shopping_list = ["banana", "orange", "apple"]

stock = {
    "banana": 6,
    "apple": 0,
    "orange": 32,
    "pear": 15
}
    
prices = {
    "banana": 4,
    "apple": 2,
    "orange": 1.5,
    "pear": 3
}

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


#2

s contains the product, so then you can use the product name to get the price of the prices dictionary (prices[s])


#3

thanks man i get it now


#4