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 are the commands that are used to copy an object in Python?



What are the commands that are used to copy an object in Python?..

Answer / chaitanya

The command that is used to copy an object in python includes:

• copy.copy() function: This makes a copy of the file from source to destination. It returns a shallow copy of the parameter that is passed.

• copy.deepcopy(): This also creates a copy of the object from source to destination. It returns a deep copy of the parameter that is passed to the function.

The dictionary consists of all the objects and the copy() method which is used as:

newdict = olddict.copy()

The assignment statement doesn’t copy any object but it creates a binding between the target and the object that is used for the mutable items. Copy is required to keep a copy of it using the modules that is provided to give generic and shallow operations.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

What are the disadvantages of Python Recursion?

0 Answers  


What is the optional statement used in a try except statement in Python?

0 Answers  


Is upper in python?

0 Answers  


Is python object-oriented? What is object-oriented programming?

0 Answers  


How do you implement json given that python is best suited for the server-side application?

0 Answers  


How to count the occurrences of a perticular element in the list?

0 Answers  


What is os module will do in python?

0 Answers  


What are the different ways to create an empty numpy array in python?

0 Answers  


What is super () react?

0 Answers  


How to compare two list?

0 Answers  


How would you perform unit-testing on your python code?

0 Answers  


What is py4j?

0 Answers  


Categories