def loop():
    for i in range (0,9):
        pass
        if i == 3:
            i = i +3
        print(i)
loop()
Current output :
0
1
2
6
4
5
6
7
8
Expecting output:
0
1
2
6
7
8
9
Does this have to do something with the way stack frames are created in Python? Why doesn't the number of iterations reduce even though we increment i ?
 
    