python学习14--Exception

1.try:

  检测代码

 except Exception [as reason]

  异常处理代码

 finally:

  总需要执行的代码

2.手动引发异常

 raise ExceptionName('异常提示语句')

posted @ 2017-01-17 13:59  YJ-20  阅读(108)  评论(0编辑  收藏  举报