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:

  • gigachad@piefed.social
    link
    fedilink
    English
    arrow-up
    2
    ·
    13 days ago

    Why can’t it just return the result but has to use the same names in both scopes, I hate it

    It’s a nice exercise and a cool visualization though

    • bterwijn@programming.devOP
      link
      fedilink
      arrow-up
      1
      ·
      12 days ago

      The whole point is to practice Python Data Model concepts, it’s not a best-way-to-code example, so feel free to hate.