一ke大白菜

关注

解决TypeError: sequence item 0: expected str instance, int found

一ke大白菜

关注

阅读 155

2022-12-05


ist包含数字,不能直接转化成字符串。
解决办法:

print(" ".join('%s' %i for i in list1))

即遍历list的元素,把他转化成字符串。这样就能成功输出1 2 3 1了。

解决TypeError: sequence item 0: expected str instance, int found_字符串


相关推荐

Sikj_6590

已解决TypeError: sequence item 0: expected str instance, list found

Sikj_6590 34 0 0

_鱼与渔_

expected str instance,float found

_鱼与渔_ 68 0 0

斗米

TypeError: can only concatenate str (not “int“) to str

斗米 143 0 0

青乌

TypeError: ‘str‘ object does not support item assignment

青乌 205 0 0

闲云困兽

scrapy+mongodb报错 TypeError: name must be an instance of str

闲云困兽 57 0 0

乱世小白

在python中遇到TypeError: can only concatenate str (not “int“) to str的解决方法

乱世小白 141 0 0

那小那小

成功解决TypeError: can‘t multiply sequence by non-int of type ‘float‘

那小那小 88 0 0

覃榜言

已解决TypeError int object is not iterable

覃榜言 38 0 0

小云晓云

dict( [1,2] ) # TypeError: cannot convert dictionary update sequence element #0 to a sequence #

小云晓云 34 0 0

半夜放水

Error:Unexpected lock protocol found in lock file. Expected 3, found 0

半夜放水 136 0 0

精彩评论(0)

0 0 举报