📜  python try except: 打印错误 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:13.240000             🧑  作者: Mango

代码示例5
1 (x,y) = (5,0)
   2 try:
   3   z = x/y
   4 except ZeroDivisionError as e:
   5   z = e # representation: ""
   6 print z # output: "integer division or modulo by zero"