I have a nested list that contains 2 names and 2 ages respectively. I need to write a function that looks through the list and counts the number of times the name appears. The list looks like this:
L = [['James', 'Alan', '20', '19'], ['Alan', 'Henry', '17', '23'], ['Bill', 'James', '40', '33'], ['Hillary', 'Phil', '74', '28']]
So this function would count that James is in the list twice, Alan twice, and the rest of the names once.