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.

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Does python have null?

810


What is abstraction in python?

881


How to walk through a list in a sorted order without sorting the actual list?

1151


How will you convert an integer to a unicode character?

845


Explain about odbc and python?

882


How to test multiple variables against a value?

966


Please write a reg expression that confirms an email id using the python reg expression module ?

1026


Which is more powerful python or c++?

817


Explain about assertions in python?

978


Explain split(), sub(), subn() methods of “re” module in python.

915


How to copy an object in python?

1024


What do you understand by *args and **kwarg python?

832


How do I run python?

811


What is the output of print str + “test” if str = ‘hello world!’?

894


What is an f string in python?

927