0

I want to delete a list without affecting my 2nd list Python

list1 = []
list2 = []
    
list1.append(1)
list1.append(2)
list1.append(3)
list1.append(4)

list2.append(list1)
list1.clear()
print(list2)

Expected output

[[1, 2, 3, 4]]

Initial Output

[[]]

How do I fix this? Thanks for any help given :)

0 Answers0