What is the difference between a shallow copy and deep copy?



What is the difference between a shallow copy and deep copy?..

Answer / Rishabh Bajpai

A shallow copy in Python copies the references to objects, while a deep copy creates a new instance of the object. In case of nested lists or complex data structures, a shallow copy will not duplicate the inner structures, while a deep copy will.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

What are its benefits of flask?

1 Answers  


How do you use super in python?

1 Answers  


What is swapcase() function in the python?

1 Answers  


Name a few methods that are used to implement functionally oriented programming in python?

1 Answers  


Are tuples mutable?

1 Answers  


What is a python module?

1 Answers  


What is setup cfg?

1 Answers  


What is filter python?

1 Answers  


What are the best sites to learn python?

1 Answers  


What is a decorator?

1 Answers  


What is metadata in python?

1 Answers  


How do you use n in python?

1 Answers  


Categories