Python流控制- 逻辑运算符

来源:互联网 发布:液晶清洁液-知乎 编辑:程序博客网 时间:2024/06/06 01:20

Python逻辑运算符

    and , or,  not    逻辑与、或、非



>>> True and  True
>>> Ture

>>> 1 and 1
>>> 1

>>> 1 and 0
>>>0 

>>> 1 and 0 adn 1
>>>0 


>>> 1 and False
>>>False

>>> 1 or False
>>>1

>>> 1 or 0 or 1
>>>1 

>>> not 1
>>> False

>>>not 0
>>> True

0 0
原创粉丝点击