二十.python中运算符----逻辑运算符(三个)

逻辑运算符:

and  与     例:a and b 整体若要为True 则 a与b都应为True 否则结果为False

or   或      例:a or b 整体若要为True 则 a与b中至少一个为True 否则为False

not  非     例: not a  整体若要为True a本身为Flase

示例:

a = 1<2
b = 1>2
print a and b
print a or b
print not a

返回结果:


猜你喜欢

转载自blog.csdn.net/Static_at/article/details/80933729