r/learnmachinelearning • u/Sea-Ad7805 • 1d ago
Python Mutability: tuple vs list
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.
3
Upvotes
View all comments
Show parent comment
6
u/crayphor 1d ago
I think it's more that += does a concatenation, then an assignment. It is not editing the tuple, it is creating a new tuple and assigning it as the value of the variable.