【发布时间】:2014-03-09 19:29:10
【问题描述】:
我有一个 str 列表,我想将其转换为单个字符串
poem = ['The time is here, the Captain said\n',
'To talk about various things: boots - and planes - and wax,\n',
'Of carrots; and queens.\n'
'And why the sea is blue;\n'
'and whether pigs can fly.\n']
我需要把这个列表转换成一个大字符串
我试过这种方法:
for words in poem:
stripped = word.strip('\n')
我做得对吗?
【问题讨论】:
标签: string list python-3.x