On 09/07/12 22:59, Abhishek Pratap wrote:
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.
You could use the next() method of the iterator. But you need to make the iterator explicit:
it = iter(xrange(start, stop,step)) for n in it: if n in mylist: for i in range(jump_size): it.next() HTH -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor