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

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -