Python Developer — Hard
Key points
- copy.copy() creates a shallow copy with shared references
- copy.deepcopy() creates a deep copy with new copies of nested objects
- Changes to nested objects in deepcopy don't affect the original
- Important to understand when working with mutable objects
Ready to go further?
Related questions
