difference between, a + 1 and a += 1 and a = a + 1

Fragment 1 a = 20 a + 1 print (a)

Fragment 1 a = 20 a + 1 print (a)

Output fragment 1:- 20 But value of variable ‘a’ will not change.

Fragment 2 a = 20 a += 1 print (a)

Fragment 2 a = 20 a += 1 print (a)

Output fragment 2:   21 But value of variable ‘a’ will change. Now new value of variable ‘a’ is 21.

Fragment 3 a = 20 a = a + 1 print ()

Fragment 3 a = 20 a = a + 1 print ()

Output fragment 3: -It will print nothing because print statement is empty. But value of variable ‘a’ will change. Now new value of variable ‘a’ is 21.

a + 1, a += 1, and a = a + 1 all involve adding 1 to the value of a, but they differ in how they modify the value of a.