elseIntermediate Playground

Catch-all branch when preceding if/elif conditions are all false

Python Playground
Output
Click "Run" to execute your code

Loop else is unusual: it runs when the loop finishes normally (without break). Think of it as 'nobreak' — it runs if break was never hit.

Challenge

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