This is what i have used to get last names
author_names = authors.split(’,’)
check =
for i in author_names:
x = i.split(’ ')
check.append(x)
print(check)
author_last_names=
for i in check:
author_last_names.append(i[-1])
print(author_last_names)
Explanation : first we make the string as a list by using author_names = authors.split(’,’)
secondly making the long list as sub list by below code :
check =
for i in author_names:
x = i.split(’ ')
check.append(x)
print(check)
Thirdly and last , append the last value to the empty list from every sub list as below :
author_last_names=
for i in check:
author_last_names.append(i[-1])
print(author_last_names)
HOPE THIS HELPS SOMEONE