Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Python Basics (Retired) Shopping List Lists and Strings

Shopping list

I don't understand where I am going wrong again. Please explain in the most simplest way , as I am 13. I know my last line is wrong, but I don't understand how to split.

greeting_list.py
full_name = "Michelle Mangwiro"
name_list = full_name.split()
greeting_list = "Hi, I'm Treehouse"
my_sentence.split()
Samy Basset
Samy Basset
11,862 Points

In your last line of your code you say my_sentence.split() but you have never defined it. So you're splitting something that don't exists. If you change the my_sentence variable to greeting_list for example your code will work(or any existing variable).

1 Answer

Hi Michelle

The second part of the challenge asks you to create a list from the string "Hi, I'm Treehouse", you can achieve this by calling the split method on the string which splits the string into a list on spaces.

greeting_list = "Hi, I'm Treehouse".split()

lastly the challenge asks you to replace the Treehouse with your name, you can achive this by changing the correct index of the greeting_list with the correct index of name_list. I dont want to give you the answer rather want you to try it for yourself.

let me know if you need any more help.