如何加入字符串列表? [英] How to join list of strings?

查看:42
本文介绍了如何加入字符串列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这对你们大多数人来说可能非常容易解决,但我无法解决这个问题,只需将 str() 放在它周围,我可以吗?

This is probably seriously easy to solve for most of you but I cannot solve this simply putting str() around it can I?

我想把这个列表:['A','B','C'] 转换成 'A B C'.

I would like to convert this list: ['A','B','C'] into 'A B C'.

提前致谢!!

推荐答案

In [1]: L = ['A', 'B', 'C']
In [2]: " ".join(L)
Out[2]: 'A B C'

这篇关于如何加入字符串列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆