Python 101 : Deep copies and shallow copies - List example -
In the below example, we make a shallow copy "l2" of a list "l1" using regular "=" assignment, we also make a deep copy "l3" of "l1".
We remove one elements from "l1" and see the impact on both "l2" and "l3".
"l3" is a deep copy of "l1", so its elements refers to another list.
Comments