Python中的布尔操作符

2024-11-01 21:16:39

1、与:and

Python中的布尔操作符

2、或:or,优先级最低。

Python中的布尔操作符

3、非:not,优先级最高。

Python中的布尔操作符

4、比较和布尔操作符混合使用:比较操作符求值为布尔型,那么就可以与布尔操作符在表达式中使用。

Python中的布尔操作符
猜你喜欢