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
value1int, float, list, string
value2any value the same datatype as value1
Related = (assign)
+ (addition)
-= (subtract assign)
Updated on Tue Jul 11 06:52:23 2017.
Creative Commons License