new_list = my_list[:]new_list = my_list
Try to understand this. Let's say that my_list is in the heap memory at location X, i.e., my_list is pointing to the X. Now by assigning new_list = my_list you're letting new_list point to the X. This is known as a shallow copy.
Now if you assign new_list = my_list[:], you're simply copying each object of my_list to new_list. This is known as a deep copy.
The other way you can do this are:
new_list = list(old_list)import copy new_list = copy.deepcopy(old_list)