Associativity of Python Operators
Associativity of Python Operators
The direction in which any given expression with more than one operator having
the same precedence is assessed is associativity. Almost every operator is
associative from left to right.
Code
12
12
Note: In Python, the exponent operation ** possesses the right to left associativity.
Code
6561
729
Code
a = b = c += 2
^
SyntaxError: invalid syntax
+= -= Addition / subtraction
*= /= Multiplication / division