Precedence and associativity

Symbol Type of operation Associativity
() Expression parenthesis Left-to-right
! Not operator Right-to-left
* / // % Multiplication, Modulo, (Integer) Division Left-to-right
+ - Add, Subtract Left-to-right
& Bitwise AND Left-to-right
^ Bitwise XOR Left-to-right
| Bitwise OR Left-to-right
== != <= >= < > Compare Left-to-right
&& Logical AND Left-to-right
|| Logical OR Left-to-right
? : Conditional Right-to-left
= *= /= %= += -= &= ^= |= Assignments Right-to-left