new_list = my_list[:]new_list = my_listTry 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 pointing to the X. This is known as 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 Deep copy.
The Other way you can do this are :
new_list = list(old_list)import copynew_list = copy.deepcopy(old_list)