How to break out of two nested for loops?

Cliff Wells logiplexsoftware at earthlink.net
Fri Jan 25 15:28:30 EST 2002


On Fri, 25 Jan 2002 14:58:33 +0100
Alex Martelli wrote:

> "Laura Creighton" <lac at strakt.com> wrote in message
> news:mailman.1011889735.22267.python-list at python.org...
> > Last night I got to thinking that instead of _except_
> > what I would like as the keyword is _discover_
> 
> Cool.  Or maybe 'expect' -- a mental-typo I do make
> sometimes for 'except' when I am _expecting_ the
> _exception_ to happen...:-).
> 

In that case, how about "unless" rather than "else" ?

try:
   MyFunction()
expect DismalFailure:
   print "Figures."
unless:
   print "It worked!"

-- 
Cliff Wells
Software Engineer
Logiplex Corporation (www.logiplex.net)
(503) 978-6726 x308
(800) 735-0555 x308

"Then with your new power you'll accomplish all sorts of cool stuff 
 in no time, and We'll All Be Sorry.  At that point you can either 
 gloat a bit, and then relent, or go ahead and send the robot army 
 after us." - Quinn Dunkan




More information about the Python-list mailing list