r/PythonLearning
•
u/Sea-Ad7805
•
2d ago
•
1
Python: Different Copying options
An exercise to help build the right mental model for Python data.
The “Solution” link uses memory_graph to visualize execution and reveals what’s actually happening.
41
Upvotes
1
2
u/AQuestionIsWhatIHave 2d ago
Everything but deepcopy creates at best a shallow copy, therefore cx[0] for all x < 6 reference the same list a[0]. Thus it's D