python if语句
2013-04-03 15:32
267 查看
#coding=utf-8 ''' Created on 2013-3-4 @author: TonyYu ''' # if语句 def tstIf(): number = 23 guess = int(raw_input('Enter an integer : ')) if guess == number: print 'Congratulations, you guessed it.' # New block starts here print "(but you do not win any prizes!)" # New block ends here elif guess < number: print 'No, it is a little higher than that' # Another block # You can do whatever you want in a block ... else: print 'No, it is a little lower than that' # you must have guess > number to reach here print 'Done' if __name__ == '__main__': tstIf()
相关文章推荐
- python if语句语法
- Python基础05 for,if 语句 【例1:数学计算】
- python基础------if条件语句
- python中的if语句
- 【Python】if语句使用规则
- Python3使用独立的if语句与使用if-elif-else结构的不同之处
- Python条件语句if…else…
- 跟老齐学Python之复习if语句
- Python 基础(四)-if语句
- python 入门系列3:if 语句
- python if elif else判断语句
- 零基础学python-2.10 条件判断 if语句
- python基础学习(四)if判断语句
- Python新手学习基础之条件语句——if/else语句
- python的条件分支语句(if)
- 零基础学python-11.1 if语句
- python --if语句
- 【python】if __name__==“__main__”判断语句的讲解
- python_if判断语句,循环语句,三目运算符
- Python 3基础教程7-if语句