Python 字符串、列表转换
Python 字符串、列表转换
1、字符转化为字典例如:
name="alex,erric"
name_list=name.split(',')
print name_list
['alex','erric']
2、列表转化为字符串
name_list=['alex','eric','tony']
name=','.join.(name_list)
print name
'alex,eric,tony'
相关内容
- 暂无相关文章
评论关闭