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

How do you sort in python 3?

0 Answers  


How will you use python to read a random line from a file?

0 Answers  


What are the two main types of functions in python?

0 Answers  


What is kwargs in python?

0 Answers  


What is constructor in python?

0 Answers  


Explain about indexing and slicing operation in sequences?

0 Answers  


What is abstraction in python?

0 Answers  


Is python sorted stable?

0 Answers  


What is python’s standard way of identifying a block of code?

0 Answers  


Why do list comprehensions write to the loop variable, but generators don’t?

0 Answers  


Differentiate between deep and shallow copy in python?

0 Answers  


How do I use strftime in python?

0 Answers  


Categories