Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What is the difference between deep and shallow copy?



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

Answer / chaitanya

• Shallow copy is used when a new instance type gets created and it keeps the values that are copied in the new instance. Whereas, deep copy is used to store the values that are already copied.

• Shallow copy is used to copy the reference pointers just like it copies the values. These references point to the original objects and the changes made in any member of the class will also affect the original copy of it. Whereas, deep copy doesn’t copy the reference pointers to the objects. Deep copy makes the reference to an object and the new object that is pointed by some other object gets stored. The changes made in the original copy won’t affect any other copy that uses the object.

• Shallow copy allows faster execution of the program and it depends on the size of the data that is used. Whereas, deep copy makes it slower due to making certain copies for each object that is been called.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

What are methods in python?

0 Answers  


If while installing a package with pip, you get the error no matching installation found, what can you do?

0 Answers  


What are the benefits of using python? What do you understand of pep 8?

0 Answers  


How to send an email in python language?

0 Answers  


How do I find out the Python version in CMD?

2 Answers  


Is Python object-oriented or functional programming?

2 Answers  


What are the different ways to generate random numbers?

1 Answers  


In python, how you can randomize the items of a list in place ?

0 Answers  


What is the use of map in python?

0 Answers  


Is Django written in Python?

0 Answers  


What is meant by“call by value” in python?

0 Answers  


Tell me the use of // operator in python?

0 Answers  


Categories