python day1 变量及IF条件函数
变量:
数字、下划线、字母表示,不能用数字开头。
以下关键字不能声明为变量名
['and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'exec', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'not', 'or', 'pass', 'print', 'raise', 'return', 'try', 'while', 'with', 'yield']
IF函数:
if (条件): (缩进表示模块代码) else(条件): (缩进)
if x=1: print('***') else: print('***')
可嵌套;
若执行空语句,写上pass。
if x=1: pass else: print('***')
浙公网安备 33010602011771号