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 trialChris Parker
1,391 PointsOops! It looks like Task 1 is no longer passing.
For the code below all is good up until stage 3 when I'm asked to "change "Treehouse" in greeting_list to the first item in your name_list variable." Doing this the way I have in the last line alters the values stored in the name_list variable resulting in Task 1 (which was to create the name_list variable with the specific values) to now fail.
Any suggestions on how to get round this?
full_name = "Christopher Parker"
name_list = list(full_name.split())
greeting_list=("Hi, I'm TreeHouse").split()
name_list[0]=greeting_list[2]
1 Answer
Chris Freeman
Treehouse Moderator 68,441 PointsVery close! but backwards: It's asking to change greeting_list
by replacing the "Treehouse" with your first name (name_list[0]
). See other comments on your code below:
full_name = "Christopher Parker"
name_list = full_name.split() # <-- split() returns list. No need to wrap with list()
greeting_list = "Hi, I'm TreeHouse".split() # <-- parens around string not needed
greeting_list[2] = name_list[0] #<-- flipped so greetlng_list item gets changed
Chris Parker
1,391 PointsThat did the trick! Thanks Chris + Phil for the help!
Philip Cox
14,818 PointsPhilip Cox
14,818 PointsHi, You don't need to use list and .split() together. This is probably the reason for your error.