breakEasy Playground

Exits the nearest enclosing for or while loop immediately

Python Playground
Output
Click "Run" to execute your code

break immediately exits the innermost loop. Code after break in the loop body is skipped.

Challenge

Try modifying the code above to explore different behaviors. Can you extend the example to handle a new use case?