Python Try - Except
It is used for error handling in python, try is used for caught and except is used to handle these errors.
Python has some built-in exceptions which stop the program execution but these not affect the output result, so to reduce these error use try-except, which handle the process and program running properly.
There are two types of error which are handled by this:
The program contains several types of exception which are handled by this:
By this program divided into the three parts:
We can easily understand it with the help of the given below example:
>>> Import sys #use to get the type of exception
>>> list = [1,2,3]
>>> for a in list:
>>> print(“value is”)
>>> result = a
>>> print(“enter another value”)
>>> print(“the result is”, a)
Now Python's basic topics are covered in the next tutorial we will cover the most important topic Python File Handling. If you have not read the previous tutorials then please first read all the video and go to the next topics file handling.