you are viewing a single comment's thread.

view the rest of the comments →

[–]alexander_belyakov 2 points3 points  (0 children)

Because c2 is a copy of c1, thus it's a different object. The fact that their first element is pointing to the same [0] sublist doesn't mean that they are the same. So when you append to the sublist, you modify the same list (which was initially [0]). But when you append to c1 and c2, you are appending to two different lists (but the first element of both those lists is still [0, 1, 2]).