myList = ['Jay', 'Phil', 'Gloria, Claire']
I want to check every element in the list and split by comma, making the two new elements stay in the same list. Output should be:
myList = ['Jay', 'Phil', 'Gloria', 'Claire']
I've tried this:
newList = []
myList = ['Jay', 'Phil', 'Gloria, Claire']
for element in myList:
newList.append(element.split(','))
but I got as output a lot of sub lists and this is not what I want:
['Jay'], ['Phil'], ['Gloria', 'Claire']
How can I solve this?