Assignment Operations

An assignment statement evaluates the expression and assigns the result to the target. Augmented assignment is the combination, in a single statement, of an operation and an assignment statement.

a = 3
b = 2

a += b    # a = 5
a -= b    # a = 3
a *= b    # a = 6
a /= b    # a = 3.0
a //= b   # a = 0.0
a %= b    # a = 1.0
a **= b   # a = 1.0

results matching ""

    No results matching ""