'''
Name: flowcontrol_while.py
Author: Yang Ze
Created: 2019.04.02
Last Modified:
Version: V1.0
Description: An example for while...else...
'''

# A optional block else is executed when while loop condition becomes False.
# The else will not be executed if you break out of the loop with break.
number = 23
running = True

while running:
    guess = int(input('Enter an integer : '))
    
    if guess == number:
        print('Congratulations, you guessed it.')
        # this causes the while loop to stop
        running = False
    elif guess < number:
        print('No, it is a little higher than that.')
    else:
        print('No, it is a little lower than that.')
else:
    print('The while loop is over.')
    # Do anything else you want to do here

print('Done')