An exercise to help build the right mental model for Python data.
- Solution: https://memory-graph.com/#codeurl=https%3A%2F%2Fraw.githubusercontent.com%2Fbterwijn%2Fmemory_graph_videos%2Frefs%2Fheads%2Fmain%2Fexercises%2Fexercise9.py&play=
- Explanation: https://github.com/bterwijn/memory_graph?tab=readme-ov-file#python-data-model
The “Solution” link visualizes execution and reveals what’s actually happening using 𝗺𝗲𝗺𝗼𝗿𝘆_𝗴𝗿𝗮𝗽𝗵: https://github.com/bterwijn/memory_graph


In my limited understanding, the 5th step
b = b + [4]would cause problems, infinite execution or alike, if it kept being a reference.Coming from MATLAB, anything but A feels like a bug. I don’t want my script to use references when initializing a variable unless I tell it to.