Python的bug
骑士坑天下
计算机只存在0和1,但是我希望自己可以从0到1
展开
-
Python中一些常见的报错类型bug
下面我列举Python中一些常见的报错类型SyntaxError: unexpected EOF while parsing#语法错误,多了无法解析的符号,检查下是否多了或者少了括号SyntaxError: invalid character in identifier#语法错误有无效标识符,检查下中文符号IndexError: list index out of range#索引错误,超出索引范围,检查下列表是否为空TypeError: must be str, not int原创 2021-02-25 15:22:26 · 257 阅读 · 0 评论 -
TypeError: sequence item 1: expected str instance, int found
今天在敲代码的时候碰到这样的问题>>> li = [1,'hello','world',2]>>> '%s'.join(li)Traceback (most recent call last): File "<pyshell#24>", line 1, in <module> '%s'.join(li)TypeError: sequence item 0: expected str instance, int found这里原创 2021-02-25 11:51:40 · 6732 阅读 · 1 评论