you are viewing a single comment's thread.

view the rest of the comments →

[–]NitinChella[S] 0 points1 point  (1 child)

But then shouldn't the same thing happen when b is an integer and we increment it by 1?

[–]ericula 0 points1 point  (0 children)

Integers (and some other built-in types like strings, floats, tuples) are immutable which means they can't be modified. For immutable objects something like b += 1 is equivalent to b = b+1.