Any help will be greatly appreciated!!!
res = []
s = [1,2,3,4,5,6]
s.pop()
res.append(s)
print res
s.pop()
res.append(s)
print res
The above python code gives the following result
[[1, 2, 3, 4, 5]]
[[1, 2, 3, 4], [1, 2, 3, 4]]
I don't understand why pop on s will affect res. I mean the print result should be
[[1,2,3,4,5]]
[[1,2,3,4,5],[1,2,3,4]]