Meaning of += in Python Programming language?
Do you know how in English we can rewrite "it is" to be "it's"?
Or we can rewrite "you are" to "you're?
That's called contraction, and this is kind of like a
contraction for the two operations = and +.That means x = x+y is the same as x += y.
Top comments (1)
Officially, this is known as a "compound operator", and there's one for each of the five basic math operators in Python:
P.S. You'll want to drop the
#help
tag from your post, as that's only for questions.#beginners
might be a good fit, though.