将s =[['a','b','c'],['d','e','f'],['g','h','i'],['j','k','l']]转换成s ="a,b,c;d,e,f;g,h,i;j,k,l"
1个回答
展开全部
[willie@localhost pys]$ python3
Python 3.5.2 (default, Dec 7 2016, 23:38:49)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> s =[['a','b','c'],['d','e','f'],['g','h','i'],['j','k','l']]
>>> ss = ';'.join([','.join(i) for i in s])
>>> ss
'a,b,c;d,e,f;g,h,i;j,k,l'
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询