Este código no tiene else, y stock vale 50.
if stock == 0:
print('agotado')
elif stock < 0:
print('error')