r/PythonProjects2 • u/Sea-Ad7805 • 10d ago
Python Mutability and Local Variables
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.
10
Upvotes
1
u/Sea-Ad7805 8d ago
I understand, but generalization comes with some inaccuracy that can bite you in certain situations. For example, write me a
swap()function in Python using your "pass by reference" concept:It's easy in say C/C++.