Python 101 (part 8): An Exceptionally Clever Snake - Strong Pythons (And The Exceptions That Love Them)
(Page 8 of 9 )
A number of standard exceptions are built into Python - here's a list ofthe most common ones.
IOError - generated when an I/O operation fails;
ImportError - generated when a module import fails
IndexError - generated when an attempt is made to access a non-existentelement index;
KeyError - generated when an attempt is made to access a non-existentdictionary key;
MemoryError - generated when an out-of-memory error occurs;
NameError - generated when an attempt is made to access a non-existentvariable;
SyntaxError - generated when the interpreter finds a syntax error;
TypeError - generated when an attempt is made to run an operation on anincompatible object type;
ZeroDivisionError - generated when an attempt is made to divide by zero.
For a complete list, take a look at
http://www.python.org/doc/current/lib/module-exceptions.htmlNext: The End Of The Affair >>
More Python Articles
More By Vikram Vaswani, (c) Melonfire