Re: multiple breaks

2008-11-15 Thread Robert Lehmann
On Thu, 13 Nov 2008 02:16:32 -0800, Chris Rebert wrote: > On Thu, Nov 13, 2008 at 2:07 AM, TP <[EMAIL PROTECTED]> > wrote: >> >> In the following example, is this possible to affect the two iterators >> to escape the two loops once one "j" has been printed: >> > Non-exception alternative: > > don

Re: multiple breaks

2008-11-13 Thread Steve Holden
Chris Rebert wrote: > On Thu, Nov 13, 2008 at 2:07 AM, TP <[EMAIL PROTECTED]> wrote: >> Hi everybody, >> >> Several means to escape a nested loop are given here: >> >> http://stackoverflow.com/questions/189645/how-to-break-out-of-multiple-loops-in-python >> >> According to this page, the best way i

Re: multiple breaks

2008-11-13 Thread Peter Otten
TP wrote: > Hi everybody, > > Several means to escape a nested loop are given here: > > http://stackoverflow.com/questions/189645/how-to-break-out-of-multiple-loops-in-python > > According to this page, the best way is to modify the loop by affecting > the variables that are tested in the loops

Re: multiple breaks

2008-11-13 Thread Marc 'BlackJack' Rintsch
On Thu, 13 Nov 2008 11:07:25 +0100, TP wrote: > According to this page, the best way is to modify the loop by affecting > the variables that are tested in the loops. Otherwise, use exception: > > "If, for some reason, the terminating conditions can't be worked out, > exceptions are a fall-back pl

Re: multiple breaks

2008-11-13 Thread Chris Rebert
On Thu, Nov 13, 2008 at 2:07 AM, TP <[EMAIL PROTECTED]> wrote: > Hi everybody, > > Several means to escape a nested loop are given here: > > http://stackoverflow.com/questions/189645/how-to-break-out-of-multiple-loops-in-python > > According to this page, the best way is to modify the loop by affec

multiple breaks

2008-11-13 Thread TP
Hi everybody, Several means to escape a nested loop are given here: http://stackoverflow.com/questions/189645/how-to-break-out-of-multiple-loops-in-python According to this page, the best way is to modify the loop by affecting the variables that are tested in the loops. Otherwise, use exception: