022Python路--异常

try:
except ValueError:
except (ZeroDivisionError,ValueError):
except Exception as result:
    print(result)
else:#没有异常执行
finally:#无论有无异常都执行

#异常的传递性
def f():
pass
def test():
return f()
try:
test()
except Exception as result:
print(result)
posted @ 2018-11-14 10:36  zhaoweiscsuse  阅读(119)  评论(0)    收藏  举报