+ 1
Why is the output [1,8,2,3,5,8] instead of [1,1,2,3,5,8]?
a = [1,1,2,3,5,8] for a[1] in a: pass print(a)
4 odpowiedzi
+ 5
Loop copying elements list elements into a[1] so list is modified by loop.
+ 5
Harsirat Singh Jouhal
Found previously posted same question. Explanation is already there. Hope it helps to understand..
https://www.sololearn.com/Discuss/3173641/?ref=app
Go through this and reply if anything not understood..
+ 2
Thanks
+ 1
Can you please explain more about this?