+ 5
I don't understand how list elements get appended to the second list l2 in the below code. Do you?
5 Antworten
+ 10
cool
try this at end of your code
for l in l2:
print(id(l))
it will clarify the case😉
+ 7
Sonic, have you read my brand-new tutorial about references yet? :)
https://code.sololearn.com/c89ejW97QsTN/?ref=app
+ 6
Sonic yes that's it👍
+ 5
Oma Falk thanks, so it means that in each iteration, what's being appended to l2 is just a reference to l1 ?