In Python 2.7 I want to modify the step of a for loop in function of the specifics conditions satisfied in the loop. Something like this:
step = 1
for i in range(1, 100, step):
if ...... :
step = 1
#do stuff
else:
step = 2
#do other stuff
but it seems that this can't be done, step is always 1.
Thanks.