while running: else:

# -*- coding:gb2312 -*-
import subprocess
import sys
#subprocess.call("pause",shell=True)
#subprocess.call("cls",shell=True)
#sys.exit(0)

number = 23
running = True

while running:
    guess = int(raw_input('Enter an integer : '))

    if guess == number:
        print 'Congratulations, you guessed it.' 
        running = False # this causes the while loop to stop
    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'

 

posted @ 2018-01-17 14:31  sky20080101  阅读(163)  评论(0)    收藏  举报