and 和运算
>>> True and True
>>> True and False
>>> 5 > 3 and 3 < 1
or 或运算
>>> True or True
>>> False or True
>>> 5 > 3 or 1 > 3
not 非运算
not True
not False
not 1 > 2
本文详细介绍了布尔逻辑运算中的and(与)、or(或)、not(非)三种基本运算符,并通过具体示例展示了它们的工作原理。文章适合初学者快速掌握逻辑运算的基础知识。
and 和运算
>>> True and True
>>> True and False
>>> 5 > 3 and 3 < 1
or 或运算
>>> True or True
>>> False or True
>>> 5 > 3 or 1 > 3
not 非运算
not True
not False
not 1 > 2
1343

被折叠的 条评论
为什么被折叠?