python continue inner for loop 1

python continue inner for loop

If the continue statement is present in a nested loop, it skips the execution of the inner loop only. 

Here is what the above code is Doing:
1. The outer loop is iterating over the list of lists.
2. The inner loop is iterating over the individual lists.
3. If the value of the inner loop is equal to 2, the continue statement is executed.
4. The continue statement skips the rest of the code in the inner loop and returns to the outer loop.
5. The outer loop continues to the next iteration.

Similar Posts