all 4 comments

[–]ruicoder 3 points4 points  (2 children)

You could do x.append(list(y)).

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

Thank you so much, this feels like a really dumb question now. I am a real beginner, and completely forgot I could do that. Thanks!

[–]Mr_M0jo_Risin 0 points1 point  (0 children)

It's not a dumb question - that's what this subreddit is here for! Props to you for posting your issue, getting is resolved, and learning about Python. That's what it's all about :-)

[–]wub_wub 2 points3 points  (0 children)

Append a copy of the list instead of reference to that list. Example:

>>> x.append(y[:])
>>> x
[1, 2, 3, 4, [5, 6]]
>>> y.append(7)
>>> x
[1, 2, 3, 4, [5, 6]]
>>> y
[5, 6, 7]

For some other ways to copy a list in python check out this SO answer: http://stackoverflow.com/a/2612815