I had learnt about the Mutability of Lists and was trying to see how it works. However, I observed something new:
x = [1, 2, 3]
y = x
print x # [1, 2, 3]
y += [3, 2, 1]
print x # [1, 2, 3, 3, 2, 1]
works all right
However, if I replace y += [3,2,1] by y = y + [3,2,1], I get the following result:
x = [1, 2, 3]
y = x
print x # [1, 2, 3]
y = y+ [3, 2, 1]
print x # [1, 2, 3]
which isn't what I had expected. Can someone please tell me how y+= is giving a different result?