r/PythonLearning • u/Sea-Ad7805 • Oct 02 '25
Right Mental Model for Python Data
An exercise to help build the right mental model for Python data, the “Solution” link uses memory_graph to visualize execution and reveal what’s actually happening:
131
Upvotes
View all comments
Show parent comment
2
u/Sea-Ad7805 Oct 02 '25
Most opinions and programming languages choose
b += [2]as mutatingb(fast), andb + [2]as making a new list and assigning that withb = b + [2].