条件测试
- Python中使用True,False标识布尔值
比较字符串
- 相同 ==
- 不同 !=
- 区分大小写
比较数字
- =
- !=
- >=
- <=
- />
- <
逻辑与,或,非
- and
- or
- not
包含,不包含
- in
- not in
if语句
- 语法格式
if condition:
do something
elif condition:
do something
else:
do something
- 格式规范
- 四格空格缩进
- 运算符两边添加一个空格
if condition:
do something
elif condition:
do something
else:
do something