breaking out of outer loops

noemailplease0001 at gmail.com noemailplease0001 at gmail.com
Tue Jan 29 14:51:04 EST 2008


Any elegant way of breaking out of the outer for loop than below, I
seem to have come across something, but it escapes me

for i in outerLoop:
   for j in innerLoop:
       if condition:
          break
   else:
       continue
    break

Thanks,
K



More information about the Python-list mailing list