Python equivalent for perl's "next"-statement?

Dave Brueck dave at solussoftware.com
Wed Oct 22 07:39:02 EDT 2003


> does anyone know an equivalent python statement for perl's 
> "next"-statement?
> (Perl's "next" skips a loop cycle and continues with the next loop 
> cycle - it does not abort the whole loop).

"continue"?

>>> for i in range(5):
...   if i == 3:
...     continue
...   print i
...
0
1
2
4

-Dave





More information about the Python-list mailing list