python英语词汇总结--python常见错误提示
1. syntaxerror: invalid syntax语法错误:无效语法
1) syntax [?s?nt?ks] 语法、句法
2) error [?er?r] 错误
3) invalid [?n?v?l?d] 无效
2. syntaxerror: unexpected EOF while parsing语法错误:多了无法解析的符号(检查是否多了或少了括号)
1) expected [?k?spekt?d] 预料、预期
2) unexpected [??n?k?spekt?d] 想不到的
3) parsing [?pɑ?z??] 句法分析
3. syntaxerror: invalid character in identifier语法错误:有无效标识符(检查中文符号)
1) character [?k?r?kt?r] 性格
2) identifier [a??dent?fa??] 标识符
4. indexerror: list index out of range索引错误:列表超出索引范围(检查列表是否为空)
1) list [l?st] 列表
2) index [??ndeks] 索引
3) error [?er?r] 错误
4) range [re?nd?] 范围
5. typeerror: must be str, not int类型错误:数据不是正确的数据类型,比如字符串和数字直接拼接(检查数据类型)
1) type [ta?p] 类型
6. indentationerror: expected an indented block缩进错误:检查代码的缩进是否正确
在公众号顶级架构师后台回复“架构整洁”,获取一份惊喜礼包。
1) indentation [??nden?te??n] 行首缩进
2) expected [?k?spekt?d] 检查
3) indented [?n?dent?d] 缩进的
4) block [bl?k] 块
7. valueerror: substring not found值错误:输入的数据类型跟要求不符合
1) substring 子串
2) found [fa?nd] 建立
8. nameerror: name 'a' is not defined未初始化对象,变量没有被定义
1) defined [d??fa?nd] 定义
9. attributeerror: 'tuple' object has no attribute 'remove'属性错误:该对象没有这个属性、方法(检查数据类型)
1) attribute [??tr?bju?t] 属性
2) tuple 元组、数组
3) object [??bd??kt] 对象
4) remove [r??mu?v] 移开、拿开、去掉