1、逻辑运行(优先级顺序:括号>not>and>or)
print(8 or 3 > 1) /**or前是数字(大于零时,直接返回数字),直接返回数字,不在看Or后的内容**/
8
print(0 or 5 > 3) /**or前是零时,检查Or后的内容**/
True
print(2 > 1 or 3)
True print(2 < 1 or 3)
3
print(0 or 3 > 1)
True print(0 or 3 < 1)
False
print(4 and 3 > 1)
True print(0 and 3 > 1)
0
print(3 > 1 and 4)
4 print(0 and 3 > 1)
0 print(3 and 4 > 2)
True
标签:逻辑运算,数字,Python,基础,零时,print,True From: https://www.cnblogs.com/leishu/p/16796470.html