宝塔服务器面板,一键全能部署及管理,送你10850元礼包,点我领取

   and 、 or 、not  三个布尔操作符号用于比较布尔值

  1.二元布尔操作符

   如果两个布尔值都为True, and操作符就将表达式求值为True,否则求值为False;如下:

>>> True and True
True
>>> True and False
False
>>> 

   以下为and的操作符的比较:

表达式                   求值
True and True           True
True and False          False
False and True          False
False and False         False

   or:只要有一个布尔值为真,or操作符就将表达式求值为True,如果都是False,则结果为False;

表达式             求值为
True or True      True 
True or False     True 
False or False    True 
False or False    False

 2.not操作符

   区别:和and和or不同,not操作符只作用域一个布尔值;

   not操作符求值为相反的布尔值

>>> not True
False
>>> not not not not True   
True
表达式        求值  
not True    False
not False   True

待补充~