python list转换字符串报错TypeError: sequence item 0: expected str instance, int found

list包含数字,不能直接转化成字符串。

解决办法:print(" ".join('%s' %id for id in list1))

个人小站,欢迎访问!http://klvr.xyz
原文地址:https://www.cnblogs.com/xxks/p/14174289.html