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...


Explain how to copy an object in Python.



Explain how to copy an object in Python...

Answer / chaitanya

There are two ways in which objects can be copied in python.

Shallow copy & Deep copy.

Shallow copies duplicate as minute as possible whereas Deep copies duplicate everything.

If a is object to be copied then

-copy.copy(a) returns a shallow copy of a.

-copy.deepcopy(a) returns a deep copy of a.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

Which db is best for python?

1 Answers  


Can a constructor be static?

0 Answers  


How memcached should not be used in your python project?

0 Answers  


What is the function of a negative index?

0 Answers  


What are python packages?

0 Answers  


What are tuples in python? How differ with lists?

0 Answers  


How to use decorators in Python?

2 Answers  


What is difference between set and list in python?

0 Answers  


What is the output of the following code and why?

0 Answers  


Which module(s) of python can be used to measure the performance of your application code?

0 Answers  


What is zip () in python?

0 Answers  


Why is not__getattr__invoked when attr==’__str__’?

0 Answers  


Categories