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 |
What are the different types of reuest in python?
Is numpy faster than pandas?
What is pydoc command?
Does python have polymorphism?
Tell me what is the command to debug a python program?
What is lambda? Why do lambda forms not have statements?
What is the difference between while and for loop?
What are domains and tuples?
You mentioned pypi in your previous answer. Can you elaborate?
Is null in python?
Is python time time utc?
Explain about pickling and unpickling?