try: num = 5 / 0 except: print("一个错误发生") raise 结果: >>> 一个错误发生 ZeroDivisionError: division by zero >>>
0