The need for exceptions

In this section, we are going to look at the need for exceptions in Python programming. The normal program flow consists of events and signals. The term exception revels that there is something wrong with your program. These exceptions can be of any type, such as zero division error, import error, attribute error, or assertion error. These exceptions will occur whenever the specified functions cannot perform their tasks properly. The moment the exception occurs the program execution stops and the interpreter will proceed with the exception handling process. The exception handling process consists of writing your code in  a try…except block. The reason the exception handling is that something unexpected happened in your program.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset