Part 8: Working on exception handling :

Part 8: Working on exception handling :

Error Handling increase the flexibility of the program without getting to exit abruptly . Handling exception at runtime is very important . Lets check out with few examples .

If you don’t know the type of exceptions that a code block can possibly raise, you can use Exception which catches all exceptions. In addition, you can have multiple except statements.

Try except can also be used outside the scope :

Try-finally :

The finally clause in the try block is a optional to catch any exception which you have missed , which will automatically fall in the finally block .

So here are the few example of handling exception .

Instructor lead Online training in Datascience join our watsapp group

Upgrade your skills join our community

Leave a Reply

Close Menu