Vidyalelo
Python · Q15

Advanced OOP Concepts

Programming · Python · question 15

Q15

What is the difference between a shallow copy and a deep copy in Python?

A.
Shallow copies copy nested objects
B.
Deep copies copy only the outer object
C.
Shallow copies copy references to nested objects
Answer
D.
Deep copies copy nested objects

Answer: Option C

Solution

Answer: Option C
Solution:
Shallow copies copy references to nested objects, while deep copies create entirely new objects.