What is the meaning of += symbol in python? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is the meaning of += symbol in python?

2nd May 2017, 12:33 PM
Heerak Ghanesh (HERO)
Heerak Ghanesh (HERO) - avatar
2 Answers
+ 2
a += 1 It's a shorthand notation for a = a + 1
2nd May 2017, 12:37 PM
Thanh Le
Thanh Le - avatar
+ 1
a = 5 a += 3 a = a + 3 a = 5 + 3 output = 8
17th May 2017, 3:45 AM
Natanacho
Natanacho - avatar