Python条件判断
条件判断让程序根据不同情况走不同分支。
if score >= 60:
print("pass")
else:
print("fail")条件通常来自:
- 比较运算:
>,<,== - 逻辑运算:
and,or,not - 成员判断:
in,not in
条件判断让程序根据不同情况走不同分支。
if score >= 60:
print("pass")
else:
print("fail")条件通常来自:
>, <, ==and, or, notin, not in