I have been trying to find a method to delete the last names and append the first names to a new list using this recursive function.
nameList = ['Julia Truong', 'Chen Wu', 'Jebb Castro', 'Ron Kenndey', 'X Y']
def convertName(nameList):
if nameList == []:
return []
else:
head = nameList[0:1]
rest = nameList[1:]
return head + convertName(rest)
print(convertName(nameList))