python之路 - 逻辑运算符

True = T

False = F

not not x 布尔"非" - 如果 x 为 True,返回 False 。如果 x 为 False,它返回 True。 not(a and b) 返回 False


python之路 - 逻辑运算符

and x and y 布尔"与" - 如果 x 为 False,x and y 返回 False,否则它返回 y 的计算值。 (a and b) 返回 。


python之路 - 逻辑运算符

or x or y 布尔"或" - 如果 x 是非 0,它返回 x 的值,否则它返回 y 的计算值。 (a or b) 返回 
python之路 - 逻辑运算符

(a and b)or (c and (not d))

=false or (True and True)

=false or True

=True