Examveda

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

D. Deep copies copy nested objects

Answer: Option C

Solution (By Examveda Team)

Shallow copies copy references to nested objects, while deep copies create entirely new objects.

This Question Belongs to Python Program >> Advanced OOP Concepts

Join The Discussion

Related Questions on Advanced OOP Concepts

What is inheritance in OOP?

A. Creating new objects from existing ones

B. Allowing objects to share attributes and methods

C. Restricting access to object attributes

D. Converting classes into objects