What is exception-
-An exception is an event which occurs during the execution of a program that break the normal flow of the program's instructions.
- We can handle exception in python by try and except block.
- Try block is a block in which we write that part of program where chances of exception will occur.
- Except is a part where we handle the generated exceptions or this block is run after the exception generate.
Keywords that are used in exception handling is-
Most common error-
- ZeroDivisionError: Occurs when any thing is divided by zero.
- NameError: It occurs when a variable name is not found. It may be local or global.
- IndentationError: if incorrect indentation, python support indentation.
- IOError: When input output task is fails then this error occur.
- EOFError: It occurs when the end of the file is reached, and yet operations are being performed.
- IndexError : when task is perform at out of index range.