nameerror raised when an operation runs out of memory raised when variable is not found in local or global scope notimplementederror raised by abstract methods oserror raised when system operation causes system related error overflowerror raised when the result of an arithmetic operation is too large to be represented referenceerror raised when weak reference proxy is used to access garbage collected referent runtimeerror raised when an error does not fall under any other category stopiteration raised by next(function to indicate that there is no further item to be returned by iterator syntaxerror raised by parser when syntax error is encountered indentationerror raised when there is incorrect indentation taberror raised when indentation consists of inconsistent tabs and spaces systemerror raised when interpreter detects internal error systemexit raised by sys exit(function typeerror raised when function or operation is applied to an object of incorrect type unboundlocalerror raised when reference is made to local variable in function or methodbut no value has been bound to that variable unicodeerror raised when unicode-related encoding or decoding error occurs unicodeencodeerror raised when unicode-related error occurs during encoding unicodedecodeerror raised when unicode-related error occurs during decoding unicodetranslateerror raised when unicode-related error occurs during translating valueerror raised when function gets an argument of correct type but improper value zerodivisionerror raised when the second operand of division or modulo operation is zero handling exceptions if you have some suspicious code that may raise an exceptionyou can defend your program by placing the suspicious code in tryblock after the tryblockinclude an exceptstatementfollowed by block of code which handles the problem as elegantly as possible syntaxhere is simple syntax of try except else blocks