An exercise to help build the right mental model for Python data.

The “Solution” link visualizes execution and reveals what’s actually happening using 𝗺𝗲𝗺𝗼𝗿𝘆_𝗴𝗿𝗮𝗽𝗵: https://github.com/bterwijn/memory_graph

  • Successful_Try543@feddit.org
    link
    fedilink
    arrow-up
    4
    ·
    11 hours ago

    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.