Highest Precedence in Python Operators
Categories: Python
The following table lists all operators from highest precedence to lowest.
Operator & Description
1. ** - Exponentiation (raise to the power)
2. ~ + - - Complement, unary plus and minus (method names for the last two are +@ and -@)
3. * / % // - Multiply, divide, modulo and floor division
4. + - - Addition and subtraction
5. >> << - Right and left bitwise shift
6. & - Bitwise 'AND'
7. ^ | - Bitwise exclusive `OR' and regular `OR'
8. <= < > >= - Comparison operators
9. <> == != - Equality operators
10. = %= /= //= -= += *= **= - Assignment operators
11. is is not -Identity operators
12. in not in - Membership operators
13. not or and - Logical operators