如何将列表中的所有字符串合并为一个大字符串? 例如:
alist = ["Hi","How are YOU","THANK YOU"]
我如何进入:
alist = ["Hi,How are YOU, THANK YOU"]
答案 0 :(得分:1)
答案 1 :(得分:1)
使用join()
alist = [', '.join(alist)]
实施例
alist = ["Hi","How are YOU","THANK YOU"]
alist = [', '.join(alist)]
print(alist)
输出
['Hi, How are YOU, THANK YOU']