python学习笔记之004.py
2017-08-10 23:08
399 查看
#!/usr/bin/env python
# coding=utf-8
# Created Time: 2017-08-07 12:39:38
# Modified Time: 2017-08-08 13:10:17
number = 23
running = True
while running:
guess = int(raw_input('Enter an integer : '))
if guess == number:
print 'Congratulations,you guessed it.'
running = True # this causes the while loop to stop
elif guess < number:
print 'No,it is a little higher than that'
running = True
else:
print 'No,it is a little lower than that'
running = False
else:
print 'The while loop is over.'
# Do anything else you want to do here
print 'Done'
# coding=utf-8
# Created Time: 2017-08-07 12:39:38
# Modified Time: 2017-08-08 13:10:17
number = 23
running = True
while running:
guess = int(raw_input('Enter an integer : '))
if guess == number:
print 'Congratulations,you guessed it.'
running = True # this causes the while loop to stop
elif guess < number:
print 'No,it is a little higher than that'
running = True
else:
print 'No,it is a little lower than that'
running = False
else:
print 'The while loop is over.'
# Do anything else you want to do here
print 'Done'
相关文章推荐
- python学习笔记之002.py
- python3学习笔记--004--基础笔记
- python学习笔记之003.py
- python学习笔记之009.py
- python学习笔记之014.py
- python3学习笔记2--命令提示符运行.py 的脚本
- 廖雪峰Python教程 学习笔记3 hello.py
- Python学习笔记----把.py程序转化成.exe完美在windows上运行
- python数据结构学习笔记-2016-10-07-01-完善后的mydate.py
- python学习笔记之019.py
- python2学习笔记之py2exe使用
- python网络编程学习笔记(10):webpy框架
- pyalgotrade-坑2-slippage错误-------python学习笔记34
- [Python学习笔记-004] 可变参数*args和**kwargs
- python 学习笔记__init__.py
- python网络编程学习笔记(10):webpy框架
- Python学习笔记(基础篇)_004_操作符
- Python学习笔记2-运行.py文件
- 【零基础入门学习Python笔记004】改进第一次设计的游戏
- Python学习笔记之__init__.py文件的作用