copy() method in Python Lists can be used to copy all the elements from the original list to the new list.
The copy() method returns the copy of original list which can be later assigned to a separate new list.
Syntax
list.copy()
l = [1, 3, 5, 2, 8, 3]
print(l.copy())
m = l.copy() # all content of list l copied to list m
print(m)
O/P
[1, 3, 5, 2, 8, 3]
[1, 3, 5, 2, 8, 3]
We can also use ‘=‘ operator instead of copy() method in order to copy content of one list to another.
Let’s see how it goes,
l = [1, 3, 5, 2, 8, 3]
m = l # copying all content of list l to list m
print(m)
O/P
[1, 3, 5, 2, 8, 3]
But, there is one drawback of using = operator, when we use = operator and try to modify one list, changes are reflected in other list too. This is because of how list objects are stored in memory.
When we write m = l, both variables point to same value and changes made on that value will be reflected on both lists.

l = [1, 3, 5, 2, 8, 3]
m = l # copying all content of list l to list m
l[1] = 10 # changing second element to 10 in list l
print(l)
print(m)
O/P
[1, 10, 5, 2, 8, 3]
[1, 10, 5, 2, 8, 3]
This is not the case with copy() method in lists as it generates a new list copied from specified list.
l = [1, 3, 5, 2, 8, 3]
m = l.copy() # copying all content of list l to list m
l[1] = 10 # changing second element to 10 in list l
print(l)
print(m)
O/P
[1, 10, 5, 2, 8, 3]
[1, 3, 5, 2, 8, 3]
That’s all here.
