and、or、not运算符是从左向右开始解析的
标题and:逻辑表达式从左向右解析的过程中,如果有常数(或变量)的值等于0(或false),则返回0(或false);如果不存在0(或false);则返回最后一个常数(或变量)。
```python
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)] on win32 Type "copyright", "credits" or "license()" for more information.
>>> 1 and 2 and 0 and 3 and 5 and 4
>0
>>> 1 and 2 and 3 and 4 and 5
>5
>>> 4 and 3 and 2 and 1
>1
>>>
or:返回逻辑表达式从左向右解析的过程中第一个常数(或变量)的值为不等于0的常数(或变量的值)
```python
```python
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> 0 or 2 or 3 or 4 or 5
2
>>> 5 or 4 or 3 or 2 or 0
5
>>> 0 or 0 or 5 or 4 or 3
5
>>>
not:返回布尔型的结果,表达式:not n,(其中n∈R,且n≠0),其结果为false,表达式:not 0,结果为true。
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> not 10.10990
False
>>> not 8
False
>>> not -11.56
False
>>> not -4
False
>>> not 0
True
>>>