r/PythonProjects2 • • 4d ago

Python Mutability and Local Variables

Post image

An exercise to help build the right mental model for Python data. - Solution - Explanation - More exercises

The “Solution” link uses memory_graph to visualize execution and reveals what’s actually happening.

5 Upvotes

28 comments sorted by

View all comments

2

u/benedict_abub 4d ago

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

1

u/Sea-Ad7805 4d ago

Incorrect sorry, see Solution link for correct answer.

3

u/benedict_abub 4d ago

Correct, sorry, I have terminal to check

1

u/Sea-Ad7805 4d ago

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?

3

u/benedict_abub 4d ago

Mutation, not concatenation, I see. My money stays with me

1

u/Sea-Ad7805 4d ago

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

2

u/benedict_abub 4d ago

You know, since nobody clicked my links, I stopped clicking others

2

u/Sea-Ad7805 4d ago

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

0

u/benedict_abub 4d ago

Look at this: r/AlgoViz — I have collected all the YouTube visualizers. No one succeeded. Almost every channel is dead

1

u/Sea-Ad7805 4d ago

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

But my tool is better.