Ant <[EMAIL PROTECTED]> wrote: > On Sep 29, 11:04 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > wrote: > ... >> What should I do if I want the outer "for" cycle to continue or break >> ? If I put a "continue" or "break" in the inner cycle, it has no >> effect on the outer cycle. > ...
> I guess to an extent it would depend on the exact situation as to > which of these is more suitable. Are there any other recommended > solutions to this? > I think the other Pythonic option you have missed is to convert the nested for loops into a single loop by writing a generator. def ranges(limit1, limit2): range1, range2 = range(limit1), range(limit2) for i in range1: for j in range2: yield i,j ... for i, j in ranges(10, 10): ... whatever ... if j==6: break -- http://mail.python.org/mailman/listinfo/python-list