我有一个名单上的名字分开了字母,我想把个人的名字连在一起。 这就是我目前拥有的:
['S', 't', 'u', 'a', 'r', 't', ' ', 'S', 't', 'e', 'v', 'e', ' ', 'A', 'n', 'd', 'r', 'e', 'w', ' ', 'L', 'u', 'k', 'e', ' ', 'S', 'h', 'a', 'n', 'e', 'y', ' ', 'L', 'u', 'k', 'e', ' ', 'M', 'o', 'l', 'e', 'y', ' ', 'M', 'o', 'l', 'e', 'y', ' ', 'R', 'o', 'b', ' ']
我想把它变成这样:
['Stuart', 'Steve', 'Andrew', 'Luke', 'Shaney', 'Luke', 'Moley', 'Moley', 'Rob']
让
info
成为你的清单。你知道吗但请看两位炼金术士的评论。你知道吗
使用^{} 并使用^{} 分组:
我不知道你是怎么看这篇文章的,但你处理得不对。不要在线调用
list()
,也不要调用从文件中读取的全部文本:如果您想要一个单词列表,只需在您阅读的文本上使用^{} :
您可以遍历列表中的字符,下面是一个小示例:
相关问题 更多 >
编程相关推荐