12. stocking out


#1

Hello!
I wonder why do I use 1 in stock[x]-=1.
I think we subtract how many we buy in stock.

please, explain for me.


12. Stocking Out - Code not working
#2

the for loop will loop over all the items you buy, each time you subtract one. So if you buy the same item multiply times, each time one will be subtracted thanks to the for loop.