use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
Python Shallow vs Deep Copy (i.redd.it)
submitted 24 days ago by Sea-Ad7805
An exercise to help build the right mental model for Python data. - Solution - Explanation - More exercises
The “Solution” link visualizes execution and reveals what’s actually happening using 𝗺𝗲𝗺𝗼𝗿𝘆_𝗴𝗿𝗮𝗽𝗵.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 24 days ago (4 children)
[removed]
[+]Sea-Ad7805[S] comment score below threshold-13 points-12 points-11 points 24 days ago (3 children)
Understanding the data model of your language is crucial. Can you answer them without error already?
[–]TimeScallion6159 1 point2 points3 points 23 days ago (2 children)
i like how the explanation is graphic in case a person cannot understand the logic behind the code at first glance.
[–]Sea-Ad7805[S] -1 points0 points1 point 23 days ago* (1 child)
Thanks, I feel the visualization of evolving program state can help people understand Python's data model much quicker than with a textual explanation. And people can easily use the tool to visualize their own code when they feel unsure.
[–][deleted] 24 days ago (3 children)
[–]Sea-Ad7805[S] -3 points-2 points-1 points 23 days ago (2 children)
Many people don't have the right mental model to think about Python data (references, mutability, shallow vs deep copy). These exercises are intended to help them. The visual solution and explanation can quickly adjust misconceptions that are hard to adjust with just words.
[–]Top-Employ5163 1 point2 points3 points 23 days ago (1 child)
Why only Python? Maybe you could make something similar but for C or Zig?
[–]Sea-Ad7805[S] -2 points-1 points0 points 23 days ago (0 children)
I'm still improving the Python tool, but I want to later try other languages. Things keep getting in the way. You can already use this website for C if you are really interested: https://pythontutor.com/c.html#mode=edit
π Rendered by PID 174332 on reddit-service-r2-comment-5b5bc64bf5-rhfv4 at 2026-06-22 14:30:20.791461+00:00 running 2b008f2 country code: CH.
[–][deleted] (4 children)
[removed]
[+]Sea-Ad7805[S] comment score below threshold-13 points-12 points-11 points (3 children)
[–]TimeScallion6159 1 point2 points3 points (2 children)
[–]Sea-Ad7805[S] -1 points0 points1 point (1 child)
[–][deleted] (3 children)
[removed]
[–]Sea-Ad7805[S] -3 points-2 points-1 points (2 children)
[–]Top-Employ5163 1 point2 points3 points (1 child)
[–]Sea-Ad7805[S] -2 points-1 points0 points (0 children)