python - Trouble with If and multiple integers -
trying fix code:
function(): answer = int(input("write number")) if answer == 101: print("you found secret!") do_stuff() elif answer >= 5 , answer <= 100 , answer >= 102: print("this not valid option!") function() else: continue other inputs
it's elif answer >= 5 (and forth) isn't working properly, moves on else: other inputs , don't know how fix it.
it's never going case
answer >= 5 , answer <= 100 , answer >= 102
! think may mean
answer >= 5 , answer <= 100 or answer >= 102
. or how about:
5 <= answer <= 100 or 102 <= answer
Comments
Post a Comment