Name | += (add assign) |
||||
---|---|---|---|---|---|
Examples |
a = 50 b = 23 a += b # Sets 'a' to 73 c = "c" c += "d" # Sets 'c' to "cd" d = [1, 2, 3] d += [4] # Sets 'd' to [1,2,3,4] | ||||
Description | Combines addition with assignment for numbers, concatenation with assignment for strings, and list appending with assignment for lists. The expression a += b is equivalent to a = a + b. | ||||
Syntax | value1 += value2 | ||||
Parameters |
| ||||
Related |
= (assign) + (addition) -= (subtract assign) |
Updated on Tue Feb 27 14:07:12 2024.
If you see any errors or have comments, please let us know.
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License