I have a nested list as shown below:
L = [['James', 'Bob', '23', '47'], ['Earl', 'Carl', '16', '43'], ['Milly', 'Wendy', '1', '21']]
I want to take the names from each of them and put them into a new list called 'newList' without the numbers.
I tried the following code:
for i in L[0][0]:
newList.append(i)
print(newList)
However, this just printed the first name and each letter was seperated by a comma. I want the new list to look like this:
newList = ['James', 'Bob', 'Earl', 'Carl', 'Milly', 'Wendy']