Deep copy and Shallow copy

Can u explain the Deep copy and Shallow copy in python ? with examples.

1 Like

@yashaswinigowdas2001
Shallow Copy stores the references of objects to the original memory address.

Deep copy stores copies of the object’s value.

Note:-
Shallow Copy reflects changes made to the new/copied object in the original object. Deep copy doesn’t reflect changes made to the new/copied object in the original object.

1 Like