字符串与列表转换

 

templist = [1, 2, 3, 4]
templist = ''.join(templist)
# '1234'

temp = 'a,b,c,d'
temp = temp.split(',')
# [a,b,c,d]

 

posted @ 2020-08-12 01:32  yhfffff  阅读(68)  评论(0编辑  收藏  举报