Account
Categories

Multiply AND Assign Operator


Definition:

The Multiply AND Assign Operator (*=) is used to multiply a variable by a value and store the result in the same variable.

It multiplies the value on the right side with the variable on the left side.

Syntax:

variable *= value

Example:

x = 5
x *= 3  # multiplies x by 3
print(x)

Output: