How can you continue
the parent loop of say two nested loops in Python?
for a in b:
for c in d:
for e in f:
if somecondition:
<continue the for a in b loop?>
I know you can avoid this in the majority of cases but can it be done in Python?
You use
break
to break out of the inner loop and continue with the parentuse a boolean flag
Here's a bunch of hacky ways to do it:
Create a local function
A better option would be to move doWork somewhere else and pass its state as arguments.
Use an exception
I would go with 5 every time.