The problem is that if the input is for example 15 it asks again and never works [closed]
The input keeps asking again and again. Even after I put in 15, 30 or 60.
stones = int(input('stones'))
while stones not in ['15', '30', '60']:
print("Your number of stones needs to be 15, 30 or 60")
stones = int(input('stones'))
while stones > 0:
print('yay')
Solution 1:
You converted your input to int
, but then you're comparing it to strings. Do:
stones = int(input('stones'))
while stones not in [15, 30, 60]:
print("Your number of stones needs to be 15, 30 or 60")
stones = int(input('stones'))