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

list包含数字,不能直接转化成字符串。 解决办法:print .join s id for id in list ...

2018-01-06 11:42 1 4990 推荐指数:

查看详情

Python 列表list字符串str 互转

一、列表list字符串str 命令(python2.x):''.join(list) 命令(python2.x):''.join(str(s) for s in list) 其中,引号中是字符之间的分割符,如“,”,“;”,“\t”,“*”等等 我的电脑是python ...

Wed Nov 14 18:23:00 CST 2018 0 3046
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM