热线电话:13121318867

登录
2019-04-18 阅读量: 484
python报错信息

python主要有两种错误:

  • 语法错误:也称为解析错误,最基本的。当Python解析器无法理解一行代码时出现。
  • 例外:执行期间检测到的错误。例如 - ZeroDivisionError。

例子:

# Python code to illustrate

# working of try()

def divide(x, y):

try:

# Floor Division : Gives only Fractional Part as Answer

result = x // y

print("Yeah ! Your answer is :", result)

0.0000
2
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子