Chapter 01 - Exception Handling in Python
Chapter 01 - Exception Handling in Python
Classification: Internal
There are three main types of errors (exceptions) a python program may
encounter. These errors are follows.
Types of
Errors
Built In Exceptions
Classification: Internal
Hence, these runtime errors can be easily handled and we can ensure
the error free execution of the program. Thereby we can improve
robustness of the program using try…except block.
Classification: Internal
Hence, these runtime errors can be easily handled and we can ensure
the error free execution of the program. Thereby we can improve
robustness of the program using try…except block.
Classification: Internal
In python a raise statement will be used to raise a manual exception. Using raise
we can raise any built in exception.
Classification: Internal
Classification: Internal
try:
The try…except block can also be
nested. It means one try block
contains another try…except block. except:
try:
except:
In this case both try…except block
works independently. The outer one
will have its separate except, else and
finally blocks as well as inner ones else:
finally:
Classification: Internal
try: try:
except: except:
else: else:
try:
except: finally:
try:
except:
else:
finally:
else:
finally:
finally:
Classification: Internal