Py in range | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Py in range

Please explain output : a=[2,4,5] for i in range(1,3): a[i]=a[i-1] print(a[i],end="") output 22?

30th Jan 2020, 2:39 AM
Gustave A C/D C ☢️ 🛸♨️🛸🛸
1 Answer
+ 3
So in the first line a[1]=2; and in the second line after a[2]=a[1]=2 repeats the same value????? same pattern??
30th Jan 2020, 7:36 PM
Gustave A C/D C ☢️ 🛸♨️🛸🛸