breaking out of nested loop

Fuzzyman fuzzyman at gmail.com
Tue Jul 12 10:41:18 EDT 2005


You either need to set a marker flag with multiple breaks - *or*
(probably more pythonic) wrap it in a try..except and raise an
exception. Define your own exception class and just trap for that if
you want to avoid catching other exceptions.

There is no single command to break out of multiple loops.

Regards,

Fuzzy
http://www.voidspace.org.uk/python




More information about the Python-list mailing list