let' turn to an example to make this nesting concept more concrete the following module filenestexc pydefines two functions action is coded to trigger an exception (you can' add numbers and sequences)and action wraps call to action in try handlerto catch the exceptiondef action ()print( []def action ()tryaction (except typeerrorprint('inner try'generate typeerror most recent matching try tryaction (except typeerrorprint('outer try'hereonly if action re-raises python nestexc py inner try noticethoughthat the top-level module code at the bottom of the file wraps call to action in try handlertoo when action triggers the typeerror exceptionthere will be two active try statements--the one in action and the one at the top level of the module file python picks and runs just the most recent try with matching except-which in this case is the try inside action againthe place where an exception winds up jumping to depends on the control flow through the program at runtime because of thisto know where you will goyou need to know where you've been in this casewhere exceptions are handled is more function of control flow than of statement syntax howeverwe can also nest exception handlers syntactically--an equivalent case we turn to next examplesyntactic nesting as mentioned when we looked at the new unified try/except/finally statement in it is possible to nest try statements syntactically by their position in your source codetrytryaction (except typeerrorprint('inner try'except typeerrorprint('outer try'most recent matching try hereonly if nested handler re-raises nesting exception handlers