- Python高级编程
- 姜增如编著
- 89字
- 2024-12-27 21:36:57
1.4.3 逻辑运算符及使用
设有两个变量a和b,分别赋值为a=10,b=26,则逻辑运算的结果如表1-7所示。
表1-7 逻辑运算符及使用

例如,print(0 and 4)的结果为0。
【例1-10】 逻辑运算符的使用。

运行结果为

设有两个变量a和b,分别赋值为a=10,b=26,则逻辑运算的结果如表1-7所示。
表1-7 逻辑运算符及使用
例如,print(0 and 4)的结果为0。
【例1-10】 逻辑运算符的使用。
运行结果为