How to split a compound word split by hyphen into two individual words
问题 I have the following list list1= ['Dodd-Frank', 'insurance', 'regulation'] I used the following to remove the hyphen new1 =[j.replace('-', ' ') for j in list1] The result I got new1= ['Dodd Frank', 'insurance', 'regulation'] The result that Ideally want is new1= ['Dodd', 'Frank', 'insurance', 'regulation'] How can I accomplish this in the most pythonic (efficient way) 回答1: list1 = ['Dodd-Frank', 'insurance', 'regulation'] new1 = '-'.join(list1).split('-') print(new1) Prints: ['Dodd', 'Frank',