'goto' in micropython
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: 'goto' in micropython
That is fine for exiting a single loop (break, while not the same, can also be used). But the OP was about breaking out of nested loops.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
-
- Posts: 847
- Joined: Mon Nov 20, 2017 10:18 am
Re: 'goto' in micropython
I use it for nested loop. I use break if needed to exit from current loop but if need to exit from higher loops I will set an exit flag for which ever higher loops I need to break out off