热线电话:13121318867

登录
2019-04-18 阅读量: 527
python异常错误列表

异常错误列表:

  • IOError:如果无法打开文件
  • KeyboardInterrupt:当用户按下不需要的键时
  • ValueError:当内置函数收到错误的参数时
  • EOFError:如果在没有读取任何数据的情况下命中文件结尾
  • ImportError:如果找不到模块

except ZeroDivisionError:

print("Sorry ! You are dividing by zero ")

# Look at parameters and note the working of Program

divide(3, 0)

输出:

Sorry ! You are dividing by zero
0.0000
2
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子