a = [1, 2] b = a # += on a list mutates in place, so b sees it too a += [3] print(b) x = 1 y = x # += on an int rebinds a only x += 1 print(y)
+= mutates a list but rebinds an int