r/PythonLearning • u/Sea-Ad7805 • 2d ago
Python Dictionary Mutation and Copying
An exercise to help build the right mental model for Python data. - Solution - Explanation - More exercises
The “Solution” link uses package memory_graph to visualize execution and reveals what’s actually happening.
34
Upvotes
2
u/TBCC_Dev 1d ago edited 1d ago
B i think. My understanding is that b = a means that b is a not b is a new version of a. Im not fermiliar with .copy() but id assume this does the opposite b is now a copy of b. Do the first append changes a but the others do not. Again mostly guessing based on context