python中list转字符串

 

命令:''.join(list)

其中,引号中是字符之间的分割符,如“,”,“;”,“\t”等等

如:

list = ["1", "2", "3", "4", "5"]

''.join(list) 结果即为:12345

','.join(list) 结果即为:1,2,3,4,5

# 坑: list 里面的数据类型必须是str的,int不可以。

posted @ 2019-05-29 17:30  油条稀饭  阅读(337)  评论(0编辑  收藏  举报