+ 1

Can someone explain the output of this code?

a=[0,1,2,3] for a[-1] in a: print(a[-1])

23rd Dec 2019, 9:49 AM
Heman Chopra
Heman Chopra - avatar
2 Answers
+ 1
Thanx for the explanation :) But i am still having confusion on last iteration How is a[3]=2
23rd Dec 2019, 10:39 AM
Heman Chopra
Heman Chopra - avatar
+ 1
Okay....got it Thanks buddy :)
23rd Dec 2019, 12:12 PM
Heman Chopra
Heman Chopra - avatar