python之异常处理
python之异常处理
python之异常处理
try-except语句:
try:
检测范围
except Exception[as reason]:
出现异常(Exception)后的代码处理
try-finally语句
try:
检测范围
except Exception[as reason]:
出现异常(Exception)后的代码处理
finally:
无论如何都会被执行的代码

相关文章: