Account
Categories

Add AND Assign Operator


Definition:

The Add AND Assign Operator (+=) is used to add a value to a variable and store the result in the same variable.

It adds the value on the right side to the variable on the left side.

Syntax:

variable += value

Example:

x = 10
x += 5  # adds 5 to x
print(x)

Output: