优先级 | 运算符 | 说明 |
---|---|---|
1 | +,- | 一元加/减运算符 |
2 | ** | 指数运算符 |
3 | not | 逻辑运算符 not |
4 | *,/,//,% | 乘,除,整除,求余 |
5 | +,- | 二元加、减 |
6 | <,<=,>,>= | 比较运算符 |
7 | ==,!= | 相等运算符 |
8 | is 、 is not | is 运算符 |
9 | in 、 not in | in 运算符 |
10 | not | 逻辑运算符非 not |
11 | and | 逻辑运算符and |
12 | or | 逻辑运算符或 or |
13 | =,+=,-=,/=,*=,//=,%=,**= | 赋值运算符 |