【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'
相关文章推荐
- Python - while语句和if语句 的 用法 及 代码
- python入门之语句(if语句、while语句、for语句)
- Python之if判断语句与while和for循环
- Python的语法及if、while、for语句
- Python基础,基本类型(整型,浮点数等)数据结构(List,dic(Map),Set,Tuple),控制语句(if,for,while,continue or break):来自学习资料
- Python - while语句和if语句 的 用法 及 代码
- Python成长之路第一篇(4)_if,for,while条件语句
- Python笔记-if语句、for循环、while循环
- python学习小结2:if和while控制语句
- Python流程语句:缩进与 if、while、for
- 【python】if&&for&&while语句
- Python语法基础_控制流语句_if、while、for
- Python简单IF,WHILE语句
- python学习2——if语句、elif、if嵌套、while循环、while嵌套
- Python学习--控制语句:if, while, for, break, continue
- python入门之语句(if语句、while语句、for语句)
- PYTHON-if while,for语句
- 初学python-----if,for,range,while语句结构
- python语法基础及if、while、for等语句介绍
- python控制流语句if、while、for、break、contnue的学习———ubuntu下python的学习(2)