[Tutor] updating step size while in loop

Abhishek Pratap abhishek.vit at gmail.com
Mon Jul 9 23:59:32 CEST 2012


hey guys

I want to know whether it is possible for dynamically update the step
size in xrange  or someother slick way.

Here is what I am trying to do, if during a loop I find the x in list
I want to skip next #n iterations.


for x in xrange(start,stop,step):
    if x in list:
         step = 14
    else:
         step = 1



Thanks!
-Abhi


More information about the Tutor mailing list