Python Forum
How to break out of nested loops - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: How to break out of nested loops (/thread-32751.html)

Pages: 1 2


RE: How to break out of nested loops - deanhystad - Mar-03-2021

Maybe there is a misunderstanding. The outer loop does not iterate from 0 to 8 (are you sure that shouldn't be range(10) to do the numbers 0 through 9?) The outer loop iterates from 0 to 3. The inner loop iterates from 0 through 8, and each time you find a digit in the inner loop and break, it will start over from 0.

You only want to break the inner loop. You want to let the outer loop run to completion.


RE: How to break out of nested loops - pace - Mar-03-2021

Your absolutely right thank you kindly, the issue was with my code timing.
stupid mistake, but you helped me identify it.. Thumbs Up