Chapter 6 (Exception Handling)
Chapter 6 (Exception Handling)
NOIDA EXTENSION
CLASS 12
COMPUTER SCIENCE
CHAPTER 6. EXCEPTION HANDLING
For coding part, kindly refer page number 262, page number 263, Examples 6.2
and 6.3.
For the descriptions of some built- in Python exceptions, refer table given on
Page Number 263.
The finally block: One can use a finally block along with a try block, just like
you use except block. Refer heading 6.4.4 on page 266 for its coding
explanation.
The difference between an except block and the finally block is that the finally
block is a place that contains any code that must execute, whether the try
block raised an exception or not.
One can combine finally with except clause. In such cases, the except block will
get executed only in case an exception is raised and finally block will get
executed ALWAYS in the end. Refer heading 6.4.4 on page 266 for its coding
explanation.