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 trialBridie Begbie
785 Pointsgreeting list step 4 help?
Can anyone explain why my last line of code isnt working?
I'm assuming they are asking me to add third part of greeting_list ("treehouse") to the beginning of the name_list. Have I understood that correctly?
Thanks
full_name = "Bridie Begbie"
name_list = full_name.split()
greeting_list = "Hi, I'm Treehouse".split( )
name_list.insert(0,greeting_list[2])
2 Answers
Andreas cormack
Python Web Development Techdegree Graduate 33,011 PointsHi Bridie
The challenge asks you to change the word Treehouse in greeting_list with your first name. You cannot use insert because that inserts a new value into the list not change its value.
full_name = "Bridie Begbie"
name_list = full_name.split()
greeting_list = "Hi, I'm Treehouse".split()
greeting_list[2]=name_list[0]
greeting=" ".join(greeting_list)
Bridie Begbie
785 PointsAh, thanks for that. I think the task could have bern worded more clearly!
michaelgosal
1,896 Pointsmichaelgosal
1,896 PointsI had the same issue, and I finally got it. Thanks a million Andreas!