not:求反 not 条件
or:或 条件1 or 条件2 有一个条件为真就为真
and:且 条件2 and 条件2 两个条件为真才为真,其余为假
共识: 数字 中0是False 其余为真
字符 空格为False 其余为假
运算法优先级:从左向右运算,最先算not
not True or False
False
>>> not True or True
True
>>>
and的短路原则
真 and xx 输出结果xx , 结果取决于xx
假 and xx 输出结果假 ,结果与xx无关,取决于假
>>> 3 and 4
4
>>> 3 and 0
0
>>> 0 and 4
0
真 or xx 输出结果为真
假 or xx 输出结果为xx
>>> 3 or 4
3
>>> 4 or 3
4
>>> 3 or 0
3
>>> 0 or False
False
>>> 0 or 4
4