Exception Handling in Python
Exception Handling in Python
Handling
Exception Handling
• Exception handling is done by try and catch block.
• Suspicious code that may raise an exception, this kind of
code will be placed in try block.
• A block of code which handles the problem is placed in
except block.
try ... except
• Syntax:
>>> raise error name