exceptIntermediate Playground

Catches and handles exceptions raised in a try block

Python Playground
Output
Click "Run" to execute your code

Catch specific exceptions first, then broader ones. All exceptions inherit from BaseException; most user-facing ones inherit from Exception.

Challenge

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