Breaking out of nested loop

Dan dwndgg at opti.cgi.net
Tue Feb 27 01:23:04 EST 2001


How might one go about breaking out of a multi level loop?

For instance, the following code will go into an endless loop.

while(1):
    while(1):
        break


Is there a statement that one can use to break out of multiple levels
of loop control?  I really hate to start littering my code with flag
variables and if statements.

-Dan




More information about the Python-list mailing list