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
Use of double quotes and single quote in python?
What is design pattern in python?
Is python good for microservices?
How do you convert string as a variable name in python?
What are closures in python?
What is the difference between old style and new style classes in python?
How do I apply a method to a sequence of objects?
In python, how do copy a file?
What is the meaning of @classmethod and @staticmethod ?
When does a dictionary is used instead of a list?
What is namespace in Python?
What is a counter in python?
Can I use Python instead of PHP?
Explain what is a flask? What are its benefits?
What python frameworks do you know?