r/PythonLearning • u/Sea-Ad7805 • 27d ago
Python Mutability, Sets and Shallow Copy
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.
30
Upvotes
2
u/deadeye_82_1 21d ago
b = b | {5} creates a new set.
b |= {4} does not create a new set
1
u/Matikus28 26d ago
E?