Python 将列表中的一个字符串转换为列表中的两个字符串

Python 将列表中的一个字符串转换为列表中的两个字符串,python,list,python-2.7,split,Python,List,Python 2.7,Split,我有这样一个清单: ['Mark', 'Reynold', 'Peter', 'Randall Macenroe'] #The list is a lot longer, so I can't go by index 我想将该列表更改为另一个列表: ['Mark', 'Reynold', 'Peter', 'Randall', 'Macenroe'] 我该怎么做?我当然可以在两个名字之间使用空格(两个名字之间总是有空格),但如何使用?您可以使用and: 您可以使用和: 这比我想象的要容易!工

我有这样一个清单:

['Mark', 'Reynold', 'Peter', 'Randall Macenroe'] #The list is a lot longer, so I can't go by index
我想将该列表更改为另一个列表:

['Mark', 'Reynold', 'Peter', 'Randall', 'Macenroe']
我该怎么做?我当然可以在两个名字之间使用空格(两个名字之间总是有空格),但如何使用?

您可以使用and:

您可以使用和:


这比我想象的要容易!工作完美。非常感谢!这比我想象的要容易!工作完美。非常感谢!
>>> lst = ['Mark', 'Reynold', 'Peter', 'Randall Macenroe']
>>> [y for x in lst for y in x.split()]
['Mark', 'Reynold', 'Peter', 'Randall', 'Macenroe']
>>>