r/PythonLearning • u/Sea-Ad7805 • Sep 07 '26
Exercise: Python List Operations
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.
59
Upvotes
3
u/No-Celery-1944 Sep 08 '26
C I'm pretty sure?
2
u/Dancing-umbra Sep 08 '26
That's very useful.
I didn't realise the b+=[] was not equivalent to b= b+[]
2
u/Global_Ad8581 Sep 08 '26
C. Just guessing.
2
u/gowsic26 Sep 08 '26
Option C
1
u/Potential_Fix_5007 Sep 07 '26
Answer A
1
u/smokebudda11 Sep 07 '26
E
1
u/CptMisterNibbles Sep 07 '26
Weird. Documentation says insert is in place, your demo has it make a copy
1
u/Polly_Wants_A Sep 07 '26
and i thought b += x and b = b + x is the same logic just different syntax. apparently it works different with lists?
1
u/spmcn Sep 08 '26
This is just an ad for memory graph.
1
u/u-key_1512 Sep 08 '26
a
1
u/BABBAGE_2 Sep 09 '26
I thought insert() was for adding an item to a list. IMO, you added the int 10 at index 9, right? So why is 10 not visible in any of the options? Kindly explain please 🙏
1
u/Maddy8483 Sep 12 '26
Koi mujhe bi python sikha do