I have come across a very interesting problem with list.append and list.pop as in the code below
x = [1,2]
y = []
y.append(x)
print(y)
print("------")
x.pop()
print(y)
Output is
[[1, 2]]
------
[[1]]
Is there any way to maintain print(y) as [[1,2]] Thanks
EDIT: Also, does anyone know why this happens?