We would greatly appreciate if you could post the code, not a picture. It just makes extra work for everybody when we have to weed out a problem in code without being able to copy or run it.
The error in this instance would appear to be this line:
prices[x] -= 1
It should be,
stock[x] -= 1