条件: if 条件: 语句块 elif: 语句块 else: 语句块 elif 表示 else if 这居然是合法的!!!1 < x < 2!!! >>> if 1 < x < 2: print('True') True and 表示且 >>> if x > 1 and x < 2: print('True') True or 表示 或 >>> x 2 >>> if x ==…
编程环境: win7旗舰版 Python 3.2.2(default, Sep 4 2011,09:51:08) 代码来源:(Python菜鸟) 代码内容: Python基本的输出语句print("String");输入语句input("Please enter what you want to say:")if else语法.while语法.for语句等嵌套语法. Python语言中函数定义的方法:def function(arg1,arg2): return…