python while循环
2017-11-16 09:22
155 查看
count = 0 answer = 10 while True: print(count) count += 1 guess = int(input('猜一个')) if guess == answer: print('ok') break elif guess > answer: print('猜大了') else: print('猜小了') if count ==10: break print('第二个while') count = 0 while count <3: count +=1 guess = int(input('猜一个')) if guess == answer: print('ok') break elif guess < answer: print('猜小了') else: print('猜大了') else: print('机会用完了')
相关文章推荐
- 笨办法学Python习题33:while循环
- Python的While循环与逻辑判断语法
- Python~if,while,for~顺序,判断,循环
- Python笔记-if语句、for循环、while循环
- 04python while循环语句
- Python while循环语句(二)
- python基础(03)——while循环和for循环
- python之路-day1-while循环
- python笔记-007-★输入和while循环
- Python中for循环和while循环的基本使用方法
- python读写文件文件中for循环和while循环区别
- Python学习笔记(While循环)
- 全面解析Python的While循环语句的使用方法
- Python新手学习基础之条件语句——While循环
- Python流程控制语句->While循环
- [零基础学python]用while来循环
- Python入门(三):if判断、for和while循环、break和continue
- Python While循环语句 Python 编程中 while 语句用于循环执行程序,即在某条件下,循环执行某段程序,以处理需要重复处理的相同任务。其基本形式为: while 判断条件:
- python 循环:for()、while()
- Python - while循环