您的位置:首页 > 编程语言 > Python开发

【python摘录02】if语句和while语句

2014-07-21 11:36 477 查看
number = 23
running = True
while running:
guess = int(raw_input('Enter an integer:'))
if guess == number:
print 'congratulations, you guessed it.'
print "(but you do not win any prizes!)"
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'
print 'Done'
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: