This is my solution

This is what i have used to get last names :slight_smile:
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

1 Like

It would be of more help were you to edit it to preserve the (non-optional) Python indentation by using the </> icon at the center of the menu bar atop the text box when it is open for typing.