We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2
Errors and typing:-
Exception Name Description
EOFError Raised when one of the built-in
functions (input( )) hits an end-of-file condition (EOF) without reading any data. (NOTE. the file.read( ) and file.readline( ) methods return an empty string when they hit EOF.)
IO Error Raised when an I/O operation
(such as a print statement, the built-in open( ) function or a method of a file object) fails for an I/O-related reason, e.g., “file not found” or “disk full”.
NameError Raised when a local or global
name is not found. This applies only to unqualified names. The associated value is an error message that includes the name that could not be found. IndexError Raised when a sequence subscript is out of range, e.g., from a list of length 4 if you try to read a value of index like 8 or E8 etc. (Slice indices are silently truncated to fall in the allowed range ; if an index is not a plain integer, TypeError is raised.) ImportError Raised when an import statement fails to find the module definition or when a from … import fails to find a name that is to be imported.
TypeError Raised when an operation or
function is applied to an object of inappropriate type, e.g., if you try to compute a square-root of a string value. The associated value is a string giving details about the type mismatch. ValueError Raised when a built-in operation or function receives an argument that has the right type but an inappropriate value, and the situation is not described by a more precise exception such as IndexError.
ZeroDivisionError Raised when the second
argument of a division or modulo operation is zero. OverflowError Raised when the result of an arithmetic operation is too large to be represented.
KeyError Raised when a mapping
(dictionary) key is not found in the set of existing keys ImportError Raised when the module given with import statement is not found.