I need to understand the difference between appending a list and appending the copy of a list in python.
This is the code:
res=[1,2,3]
res1=[1,2,3]
c1=[5]
res.append(c1.copy())
res1.append(c1)
print(res)
print(res1)
Result:
[1, 2, 3, [5]]
[1, 2, 3, [5]]
1