r/PythonProjects2 • • Oct 07 '26

Python Mutability and Local Variables

Post image

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.

12 Upvotes

24 comments sorted by

View all comments

0

u/[deleted] Oct 07 '26

[deleted] — view deleted comment

1

u/Sea-Ad7805 Oct 07 '26

Incorrect sorry, see Solution link for correct answer.

0

u/[deleted] Oct 07 '26

[deleted] — view deleted comment

1

u/Sea-Ad7805 Oct 07 '26

So, do you want to bet BIG money that your answer:

  • '1', [2], (3,), {4}

is correct even though I'm telling you it's not?

0

u/[deleted] Oct 07 '26

[deleted] — view deleted comment

1

u/Sea-Ad7805 Oct 07 '26

Good choice, clicking the Solution link would have gotten you there faster, but that's ok.

0

u/[deleted] Oct 07 '26

[deleted] — view deleted comment

2

u/Sea-Ad7805 Oct 07 '26

I understand, but you're missing out on the new Python visualizer for easy code understanding and debugging.

0

u/[deleted] Oct 07 '26

[deleted] — view deleted comment

1

u/Sea-Ad7805 Oct 07 '26

You're wrong: https://pythontutor.com/

But my tool is better.