I was trying to understand the following code
a=[0,1,2,3]
for a[-1] in a:
print(a[-1])
I expected an infinite loop printing 3 but the output is quite incomprehensible as below
output:
0
1
2
2
can somebody Please explain the working of this code!
Thanks in advance