条件语句
if语句
- if语句只有条件表达式expression为真是才执行后续代码块代码,否则跳过。
- 单个if语句中的expression可以通过and,or, not实现多重条件判断。
if expression:
expr_true_suite
if 2 > 1 and not 2 > 3:
print('Correct Judgement!')
# Correct Judgement
if expression:
expr_true_suite
if 2 > 1 and not 2 > 3:
print('Correct Judgement!')
# Correct Judgement