Python Forum
How to break out of nested loops
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to break out of nested loops
#11
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.
Reply
#12
Your absolutely right thank you kindly, the issue was with my code timing.
stupid mistake, but you helped me identify it.. Thumbs Up
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  for loops break when I call the list I'm looping through Radical 4 889 Sep-18-2023, 07:52 AM
Last Post: buran
  reduce nested for-loops Phaze90 11 1,902 Mar-16-2023, 06:28 PM
Last Post: ndc85430
  Nested for loops: Iterating over columns of a DataFrame to plot on subplots dm222 0 1,714 Aug-19-2022, 11:07 AM
Last Post: dm222
  Nested for loops - help with iterating a variable outside of the main loop dm222 4 1,588 Aug-17-2022, 10:17 PM
Last Post: deanhystad
  breaking out of nested loops Skaperen 3 1,223 Jul-18-2022, 12:59 AM
Last Post: Skaperen
  Break out of nested loops muzikman 11 3,342 Sep-18-2021, 12:59 PM
Last Post: muzikman
  Nested for Loops sammay 1 8,631 Jan-09-2021, 06:48 PM
Last Post: deanhystad
  How to make this function general to create binary numbers? (many nested for loops) dospina 4 4,414 Jun-24-2020, 04:05 AM
Last Post: deanhystad
  Conditionals, while loops, continue, break (PyBite 102) Drone4four 2 2,977 Jun-04-2020, 12:08 PM
Last Post: Drone4four
  Python beginner - nested while loops mikebarden 1 1,870 Jun-01-2020, 01:04 PM
Last Post: DPaul

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020