looking for some solutions? You are welcome.

SOLVED: Python While Loop not executing else block

Richardson Harrison:
def jump_slide():

    num=int(input('Enter a number :'))
    if num>20:
        print('slide under')
    else:
        print('jump over')

The above runs just fine when not in a while loop.
But once in the loop below, it completely ignores the else block

while True:
   jump_slide()

Any suggestion please.
I'm new to Python



Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
Share:

No comments:

Recent