Exception Handling
Exception Handling
Exception Handling
syllabus
2023-24
Chapter 3
Exception handling
except:
# optional block
# Handling of exception (if required)
else:
# execute if no exception
finally:
# Some code .....(always executed)
finally:
# this block is always executed
# regardless of exception generation.
print('This is always executed')