Skipping Parts of a For Loop

Thomas Guettler pan-newsreader at thomas-guettler.de
Sat Sep 14 06:23:44 EDT 2002


Hi!

Is there a way to skip some parts in a for loop?


for i in range(3):
	print "i before", i
	i=2
	print "i after", i

#Results in:

i before 0
i after 2
i before 1
i after 2
i before 2
i after 2

Is there a way to skip some parts?

"continue" skipps one element. But how can
I skip several?

 thomas



More information about the Python-list mailing list