What is the difference between Deep copy and Shallow copy in Python | Python Interview Questions #12

Опубликовано: 26 Июнь 2026
на канале: Coding With Roy
3,537
83

In Python, variables don't store the actual objects, they store the reference to the objects that are in the memory heap. And when we assign
(using = operator) an object to separate variables, the objects do not get copied, but rather, the variables share the same references to the original objects.

Because of this, we need separate module for copying objects in Python, where we will create copies of objects instead of referencing same memory addresses. And here we have two type of copies, Deep copy and Shallow copy.

This is a very famous interview questions, and hope this video will clear out all your doubts regarding deep copy and shallow copy.

Python interview Questions Series:
   • Python Interview Questions Series - Beginn...  

Connect with me on LinkedIn:
  / sukanta-roy-448a5856  

Timestamps:
0:00 - Introduction
1:04 - Why we need a different copy module in Python?
3:26 - Code example
5:35 - What is Shallow copy?
7:38 - What is Deep Copy?
9:21 - Shallow copy code example
11:52 - Deep copy code example

Please subscribe to the channel if you like the content and would want to see more content like these.