标签:join
>>> name=‘lizhanguo wangyuwei lixuehan‘
>>> a = name.split()
>>> a
[‘lizhanguo‘, ‘wangyuwei‘, ‘lixuehan‘]
>>> b = ‘,‘.join(a) 注:以逗号分隔
>>> b
‘lizhanguo,wangyuwei,lixuehan‘
>>> c = ‘ ‘.join(a) 注:以空格分隔
>>> c
‘lizhanguo wangyuwei lixuehan‘
本文出自 “zhanguo1110” 博客,请务必保留此出处http://zhanguo1110.blog.51cto.com/5750817/1610443
标签:join
原文地址:http://zhanguo1110.blog.51cto.com/5750817/1610443