python之路-day1-while循环
2017-04-22 11:27
357 查看
while Thue: (条件为真无限循环) break(跳出循环)
猜年龄:
猜年龄:
#Author:zww age_of_jay = 40 count = 0 while count < 3: guess_age = int(input("guess_age:")) if guess_age > age_of_jay: print("think smaller...") elif guess_age < age_of_jay: print("think bigger...") else: print("yes,you got it!") break count +=1 if count == 3: conutine_confirm = input("do you want to keep guessing...?") if conutine_confirm != "n": count = 0 else: print("you have tried too many times...fuck off")
相关文章推荐
- python之路 - while,for循环小习题
- python语言if判断,for,while循环,自编的小例子,规范版
- python while循环实例
- Python 核心编程 例8.1 while-else循环举例
- python中循环语句while用法实例
- python中循环语句while用法实例
- Python的while循环
- 零基础学python-2.12 循环while语句
- [零基础学python]用while来循环
- python中while循环和for循环的用法
- python中的while循环
- python读写文件文件中for循环和while循环区别
- 2.9 python中的while循环语句 [python入门教程]
- Python for, while循环后面加else的作用
- Python学习:两种循环语句for和while
- Learn Python The Hard Way学习(33) - While循环
- Python while循环语法
- Python中的判断、循环 if...else,while
- python中while循环语句用法简单实例
- 零基础学python-2.12 循环while语句