try: print(1) print(10 / 0) except ZeroDivisionError: print(var) finally: print("最终被执行") 结果: >>> 1 最终被执行 ZeroDivisionError: division by zero During handling of the above exception, another exception occurred NameError: name 'var' is not defined (在处理上面错误时候,另一个错误发生, 名称错误:没有var 没有定义过) >>>