【发布时间】:2018-11-03 23:17:51
【问题描述】:
我想要什么
sentence = ["This","is","a","short","sentence"]
# Desired Output
T h i s
i s
a
s h o r t
s e n t e n c e
>>>
我尝试了什么
sentence = [row.replace(""," ") for row in sentence]
for item in sentence:
print(item)
这个问题是它在每行的开头和结尾打印一个空格,但我只希望每个字母之间有一个空格
【问题讨论】: