human
I am working on the file "Section 2 - Advance Python/Chapter S2.12 - Weak Reference, Copy/copy.ipynb".
The first task is:
Deep Copies
The deep copy created by deepcopy() is a new container populated with copies of the contents of the original object. To make a deep copy of a list, a new list is constructed, the elements of the original list are copied, and then those copies are appended to the new list.
Replacing the call to copy() with deepcopy() makes the difference in the output apparent.
Can you write Python code for it?

What is a the Python code you requested?
assistant
#Here is the Python code you requested.

import copy

class MyTry:
    def __init__(self):
        self.lst = [1,2,3,4,5]

a = MyTry()
dup = copy.deepcopy(a) 
a.lst.append(6)
print(a.lst, dup.lst)
print(id(a), id(dup))
print(id(a.lst), id(dup.lst))

lst = [1,2,3,4,5]
dup_lst = copy.deepcopy(lst)
print(id(lst), id(dup_lst))

import copy

class MyTry:
    def __init__(self):
        self.lst = [1,2,3,4,[5]]

a = MyTry()
dup = copy.deepcopy(a) 
a.lst.append(6)
print(a.lst, dup.lst)
print(id(a), id(dup))
print(id(a.lst), id(dup.lst))