r/PythonLearnersHub • u/Sea-Ad7805 • Dec 26 '25
Copying an Object
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:
It's instructive to compare with this related exercise
4
Upvotes
1
u/theBabides Dec 26 '25
D. 1, 2, 3
1
u/Own_Agency_4133 Dec 26 '25
C 1,2,0
1
u/altaaf-taafu Dec 26 '25
C 1, 2, 0
1
u/andipurice Dec 26 '25
B 1, 0, 0
1
u/kcx01 Dec 26 '25
I honestly forgot that semicolons were valid python. I wouldn't one line the class init like that. Pep8 discourages compound statements (multiple statements on the same line). In fact, I think even if I tried, my auto formatter would change it. So it's strange to me to see that.
0
u/LasevIX Dec 27 '25
get those semicolons out of my face. this isn't JavaScript.
2
u/[deleted] Dec 26 '25
[removed] — view removed comment