If you look at the documentation for the pop method,
Remove the item at the given position in the list, and return it. If no index is specified, a.pop()removes and returns the last item in the list.
For example,
x = [1, 4, 6, 8, 34]
y = x.pop()
print(y) # 34
print(x) # [1, 4, 6, 8]
# The popped/removed element is returned by the pop method.
# The original array is mutated.
I used both .split() and .pop() in a function to accomplish this task, I took advantage of the returning property of .pop() to store the last name. This is the function:
def last_names(authors):
last_names_list =
for author in authors:
splitted_author = author.split(" ")
last_name = splitted_author.pop()
last_names_list.append(last_name)
return last_names_list