an "exceptionis usually defined as "something that does not conform to the norm,and is therefore somewhat rare there is nothing rare about exceptions in python they are everywhere virtually every module in the standard python library uses themand python itself will raise them in many different circumstances you've already seen some of them open python shell and entertest [ , , test[ and the interpreter will respond with something like traceback (most recent call last)file ""line in test[ indexerrorlist index out of range indexerror is the type of exception that python raises when program tries to access an element that is not within the bounds of an indexable type the string following indexerror provides additional information about what caused the exception to occur most of the built-in exceptions of python deal with situations in which program has attempted to execute statement with no appropriate semantics (we will deal with the exceptional exceptions--those that do not deal with errors--later in this those readers (all of youwe hopewho have attempted to write and run python programs will already have encountered many of these among the most commonly occurring types of exceptions are typeerrornameerrorand valueerror handling exceptions up to nowwe have treated exceptions as fatal events when an exception is raisedthe program terminates (crashes might be more appropriate word in this case)and we go back to our code and attempt to figure out what went wrong when an exception is raised that causes the program to terminatewe say that an unhandled exception has been raised an exception does not need to lead to program termination exceptionswhen raisedcan and should be handled by the program sometimes an exception is raised because there is bug in the program (like accessing variable that doesn' exist)but many timesan exception is something the programmer can and should anticipate program might try to open file that does not exist if an interactive program asks user for inputthe user might enter something inappropriate