File tree 1 file changed +12
-3
lines changed
1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -227,9 +227,18 @@ expression, then you can write something like `(2 + 3) * 4`.
227
227
=== Associativity
228
228
229
229
Operators are usually associated from left to right. This means that operators with the same
230
- precedence are evaluated in a left to right manner. For example, `2 + 3 + 4` is evaluated as `(2 +
231
- 3) + 4`. Some operators like assignment operators have right to left associativity i.e. `a = b = c`
232
- is treated as `a = (b = c)`.
230
+ precedence are evaluated in a left to right manner. For example, `2 + 3 + 4` is evaluated as `(2 + 3) + 4`.
231
+
232
+ Assignment operators are the same. For example, `a = b = c` is treated as:
233
+
234
+ [source,python]
235
+ --------------------------------------------------
236
+ temp = c
237
+ a = temp
238
+ b = temp
239
+ --------------------------------------------------
240
+
241
+ In this case `temp` is a temporary variable, actually it does not exist, or we can say it will be deleted then.
233
242
234
243
=== Expressions
235
244
You can’t perform that action at this time.
0 commit comments