--> Explanation of how 'break' works in Nested loop in python language :
-
‘Break’ in Python is a control flow statement. It is used to control the sequence of the loop. Suppose you want to terminate a loop and skip to the next code after the loop; 'break' will help you do that.
-
You can use 'break' in Python in all the loops: while, for, and nested. If you are using it in nested loops, it will terminate the innermost loop where you have used it, and the control of the program will flow to the outer loop. In other words, it breaks the sequence of the loop, and the control goes to the first statement outside the loop.