SAP Interview Question

what is difference shallow copy deep copy in Python?

Interview Answer

Anonymous

Apr 19, 2024

Shallow copy is used when a new instance type is created, while deep copy saves the values that have already been copied, whereas shallow copy saves the values that have been copied. In other words, shallow copying makes the program run faster, while deep copying makes it slower.