I want to change the value of the index of the for loop inside the loop with an if statement.
for i in range(0,10):
print(i)
if i==5:
i=10
The result is
0
1
2
3
4
5
6
7
8
9
What I am expecting is:
0
1
2
3
4
5
I want to change the value of the index of the for loop inside the loop with an if statement.
for i in range(0,10):
print(i)
if i==5:
i=10
The result is
0
1
2
3
4
5
6
7
8
9
What I am expecting is:
0
1
2
3
4
5