捕获所有异常
捕获所有异常
Exception
是所有程序异常类的父类。输出的描述信息,具体到导致错误的特定异常类型。
try:
print(num)
except Exception as result:
print(result)
Exception
是所有程序异常类的父类。输出的描述信息,具体到导致错误的特定异常类型。
try:
print(num)
except Exception as result:
print(result)