first_loop_done, second_loop_done = False, False
while (...) and (not first_loop_done):
...
for (...):
if second_loop_done:
break
...
for (...):
if (...):
first_loop_done, second_loop_done = True, True
break
...
In general, I'd argue that break and continue are things that shouldn't ever appear in python code. I don't believe I've ever seen a situation that couldn't be more gracefully handled another way.
0
u/[deleted] Jan 05 '18
[deleted]