Stocking out


#1

hi my code is exactly as you say but error message says line 23 can't assign to function call


Stocking Out
#2

you are 100% behind your code? A typo or anything is easily made, please share your code so you can be helped


#3

please help,my code is as follows

def compute_bill(food):
     total = 0
for key in food
    if stock(key) > 0
        total += prices(key)
        stock(key) = stock(key) - 1
    return total

error message is line 23 can't assign to function call


#4

i have checked the indents thanks


#5

why is your for loop not in the function?


#6

thanks for pointing out but I still can't see the problem.


#7

this is currently your function + function content:

def compute_bill(food):
     total = 0

why is the for loop:

for key in food
    if stock(key) > 0
        total += prices(key)
        stock(key) = stock(key) - 1
    return total

not part of function content?


#8

Thanks, solved it with a bit of help from archievs. Regards anilkumb659


#9