码迷,mamicode.com
首页 > 其他好文 > 详细

string和list互转

时间:2017-05-01 22:28:20      阅读:200      评论:0      收藏:0      [点我收藏+]

标签:code   list   color   class   join   log   logs   import   span   

 1 import string
 2 str = ‘abcde‘
 3  list = list(str)
 4 list
 5 [‘a‘, ‘b‘, ‘c‘, ‘d‘, ‘e‘]
 6 str
 7 ‘abcde‘
 8 str_convert = ‘‘.join(list)
 9 str_convert
10 ‘abcde‘

 

string和list互转

标签:code   list   color   class   join   log   logs   import   span   

原文地址:http://www.cnblogs.com/standby/p/6792967.html

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!