看下面这个函数 def test(): sum = 3/0 if __name__ == '__main__': test() 除0肯定是不对的,会引发一个except,内容如下: File “E:\Src\dongsheng\TestPython\testtrace_back.py”, line 23, in test() File “E:\Src\dongsheng\TestPython\testtrace_back.py”, line 19, in test sum = 3/0 ZeroDivisionError: integer division or mod