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

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -