I try to skip several steps in for loop like while loop.
In the while loop, the steps are adjusted to specific conditions as shown in the code below.
i = 0
while i <10:
if i == 3:
i = 5
else:
print(i)
i = i + 1
#result 0 1 2 6 7 8 9
However, I tried to adjust the steps of the for loop in the same way, but failed.
for i in range(10):
if i == 3:
i = 5
else:
print(i)
#result 0 1 2 4 5 6 7 8 9
Can't I control step 'i' directly in a for loop?
If there is a way, let me know and I would appreciate it.