逻辑运算符总结:
and 一假必假,两真才为真
or 一真必真,两假才为假
not 真亦假,假亦真
实例:
# and
In [1]: 1 and 2
Out[1]: 2
In [2]: 0 and 1
Out[2]: 0
# or
In [3]: 1 or 1
Out[3]: 1
In [4]: 1 or 0
Out[4]: 1
In [5]: 0 or 1
Out[5]: 1
# not
In [6]: not 1
Out[6]: False
In [7]: not 0
Out[7]: True