+ 2
Can someone explain to me this code under in steps? Thank you!
a = [0, 1, 2, 3] for a[-1] in a: print (a[-1])
4 ответов
+ 4
this code will iterate through the list four times as there are four items and will print all the numbers except the last number
as follow :
0
1
2
2 # not 3
0
And what does line 2 and 3 do?
0
Ahaa now I get it, thank you
0
But why it prints out 2 two times?