Breakcontinue

Next are two commands that can be used inside for and while types of loop.

break

The break clause exits a loop statement without executing the else clause.

continue

The continue clause skips the rest of the loop block, jumping all the way back to the loop top.

>>> x = 5 >>> while x > 0: ... x = x - 1

Last updated on 1/30/2002 Python Developer's Handbook, © 2002 Sams Publishing

< BACK Make Note | Bookmark CONTINUE >

0 0

Post a comment