Python for loop question

Posted by Joe Dunk on Stack Overflow See other posts from Stack Overflow or by Joe Dunk
Published on 2010-03-12T00:00:39Z Indexed on 2010/03/12 11:17 UTC
Read the original article Hit count: 137

Filed under:
|
|

I was wondering how to achieve the following in python:

for( int i = 0; cond...; i++)
  if cond...
    i++; //to skip an run-through

I tried this with no luck.

for i in range(whatever):
  if cond... :
    i += 1

© Stack Overflow or respective owner

Related posts about python

Related posts about for-loop