python | 运算符 | 逻辑运算符
程序员文章站
2024-03-15 14:41:17
...
# encoding: utf-8
# None与0都为False
print(bool(None))
print(bool(0))
# 短路运算符规则
# 假与取左
print(0 and 90)
# 真或取左
print(90 or 43)
# 假或取右
print(0 or 78)
# 真与取右
print(78 and 89)