My solution

authors = “Audre Lorde,Gabriela Mistral,Jean Toomer,An Qi,Walt Whitman,Shel Silverstein,Carmen Boullosa,Kamala Suraiyya,Langston Hughes,Adrienne Rich,Nikki Giovanni, lolo lala lele”

print(authors)
print("")
author_names = authors.split(’,’)

print(author_names)
print("")

word=""
for i in author_names:
nombre=i
long=len(nombre)-1
for i in range(len(nombre)):
long=long-1
if nombre[long] == " ":
cont=i+1
word=word+nombre[-cont:]+nombre[long]
break

author_last_names = word.split()
print(author_last_names )

Hey, welcome to the forums. :slight_smile:
In the future, you can use “Preformatted text” option to make your code be easily readable and display nicely. This menu is just above the message box, when you’re writing or editing a post.
codequote

E.g:
for i in author_names:
print(i)
as preformated text would show like this:

for i in author_names:
    print(i)

PS I also didn’t know about it at first :wink: