Breaking out of nested loop

Fredrik Lundh fredrik at pythonware.com
Tue Feb 27 02:01:34 EST 2001


"Dan" wrote:
> 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

refactor: return, raise.

(see http://www.refactoring.com/)

Cheers /F





More information about the Python-list mailing list