| Precedence | Category / Operator | Description / Example |
|---|
| 1 (Highest) | (...), [...], {...} | Parentheses, list/dict/set displays, comprehensions |
| 2 | x[i], x[i:j], x.attr, x(...) | Subscriptions, slicings, attribute references, method calls |
| 3 | await x | Await expression |
| 4 | ** | Exponentiation (Power) (2∗∗3=8) |
| 5 | +x, -x, ~x | Unary plus, unary minus, bitwise NOT |
| 6 | *, /, //, % | Multiplication, division, floor division, remainder/modulo |
| 7 | +, - | Addition and subtraction |
| 8 | <<, >> | Bitwise shifts |
| 9 | & | Bitwise AND |
| 10 | ^ | Bitwise XOR |
| 11 | | | Bitwise OR |
| 12 | in, not in, is, is not, <, <=, >, >=, !=, == | Comparisons, membership tests, identity tests |
| 13 | not x | Boolean NOT |
| 14 | and | Boolean AND |
| 15 | or | Boolean OR |
| 16 | if - else | Conditional expression (x if cond else y) |
| 17 | lambda | Lambda expression |
| 18 (Lowest) | := | Assignment expression (Walrus operator) |