Python学习笔记四:if语句
2010-03-09 08:02
801 查看
#coding:utf-8 #特殊说明 #if/elif/else开头的行需要用冒号:结束 #if/elif/else行下面的表达式必须至少有一个空格的缩进,表明这条语句属于if语句的一部分 #elif语句的数量没限制 #但是,如果是空语句,需要增加pass,否则会报错 x = raw_input('Please input some value:') print 'x=',x print '----------begin------------' if (int(x)>100): print "x>100" print "The First statement" elif (int(x)>50): print 'x>50' print "The Second statement" elif (int(x)>30): pass else: print 'x<=30' print '-----------end-------------'
相关文章推荐
- Python学习笔记(九):if、while、for语句
- Python学习笔记——if语句
- python 学习笔记 if语句
- python 学习笔记 if语句(10)
- Python学习笔记四:if语句
- 学习笔记☞ python 基础(python3)【二】(运算符(比较,正负号,布尔),if语句)
- Python学习笔记(二):if语句的使用
- Python 【条件分支】(if 语句) 学习笔记
- Python学习笔记--(三)if语句
- Python学习笔记(二)if语句的简单用法
- python 学习笔记 if语句
- Python学习笔记_5_if语句
- 【学习笔记】Python条件判断-If语句
- Python学习笔记之if语句的使用示例
- Python学习笔记(4)-if语句
- c语言学习笔记8之if语句
- C++学习笔记(二) if语句
- Python 学习笔记(一)语句,变量,函数
- shell脚本 if语句学习笔记
- Python学习笔记整理(十)Python的if测试