各种报错

【syntaxError:invalid syntax】(语法错误:无效语法)。

多为各种该用英文符号而错用中文符号的报错情况

 

【TypeError:can only concatenate str (not "int") to str】(类型错误:只能将字符串与字符串拼接)

留意整数与字符串的拼接,容易出现整数+‘字符串’,出现类型错误

 

【ValueError:invalid literal for int() with base 10: '3.8'】(值异常:浮点类型字符串无法使用int()强制转换)。

 

【IndentationError: expected an indented block】(缩进错误:期望一个缩进块)

 

【TypeError: append() takes exactly one argument (2 given)】append后的括号里只能接受一个参数,但却给了两个。所以,用append()给列表增加元素,每次只能增加一个元素。

 

【ZeroDivisionError: division by zero】0是不可以做除数的

 

【NameError: name 'name' is not defined】使用了未经定义的变量

 

posted @ 2020-02-29 21:20  朱仔156  阅读(145)  评论(0)    收藏  举报