Problem in "splitting strings II lesson"

Hello, I’m currently doing the Python Fundamentals course, in the data science path, and was trying to do different solutions for the Splitting Strings II lesson:

Can someone explain to me why this particular solution didn’t work out?

For some reason, when I try to add name[1] to the last_author_names list it adds every individual letter.

I think it has to do with your section where you are trying to append the last name. Currently you are just adding the first letter.

Try something more like where you are appending based on the negative index:


Did you check the solution to compare to your answer?

1 Like

You want to use the append method, like so;

+= would also work if you did;
author_last_names += [name[1]] ← putting it back into a list of one item

It’s because you’re effectively trying to add a string onto a list, python is trying to work it out best it can behind the scenes, and that’s the result.


Yes, that’s exactly what was happening, thanks!


The solution did use the append method, but I was trying to do it using +=

1 Like

I’m glad you could figure it out though! That’s what matters! Happy Coding!

1 Like