📜  列表到字符串 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:12.707000             🧑  作者: Mango

代码示例6
# Python program to convert a list 
# to string using list comprehension 

s = ['I', 'ate', 2, 'shake', 'and', 3, 'chocolates'] 

# using list comprehension 
listToStr = ' '.join([str(element) for element in s]) 

print(listToStr)