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 trialchey pettitt
657 Pointsstuck on a simple task
Create a variable named greeting_list that's the string "Hi, I'm Treehouse" split on the spaces.
i think its greeting_list = "hi, im treehouse" greeting_list.split(" ")
not to sure
full_name = "chey pettitt"
name_list = full_name.split(" ")
2 Answers
Rich Bagley
25,869 PointsHi Chey,
You're almost there but the challenges can get quite specific so you'll need to follow the casing and punctuation, e.g.:
greeting_list = "Hi, I'm Treehouse".split(" ")
EDIT: Sorry, misread your question slightly. The next stage will require the following:
greeting_list[2] = name_list[0]
Treehouse is item 2 in the list (with Hi being 0).
Your first name will be item 0 in name_list.
-Rich
Blaise Gratton
30,213 PointsThis should work just fine - be sure you only have one space, or if nothing else, it could be an internal processing error on the Treehouse side of things. Also, just to be sure, you're using "chey pettitt", not "hi, I'm treehouse"?
chey pettitt
657 Pointshey Rich im nearlly there i just need to make a variable named greeting where you join greeting_list back into a string, separated by spaces. You should end up with "Hi, I'm <your first name>" as the value of greeting.
Rich Bagley
25,869 PointsRich Bagley
25,869 PointsHi Chey,
Just updated my answer above (see the edit).
-Rich