June 2002
Beginner to intermediate
640 pages
14h 24m
English
The try statement specifies a way to handle exceptions. One form is the following:
try:
suite
except expression-target:
suite
except:
suite
which can have one or many except clauses—the exception handlers. If an exception occurs in the try clause's suite of statements, an exception handler that best fits it will be invoked. An except clause that doesn't have an expression target can act as a catchall bucket. If an exception doesn't have a specific exception handler and an except clause without an expression target is present, the exception will go to that clause.
The Call StackA call stack represents the order of called functions. For example, if a module calls function A() and function A() calls function B() and function ... |
Read now
Unlock full access