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 trialhubert chen
12,761 Pointslists and basics code challenge python
What's wrong with my code, I can't seem to figure it out.
full_name="Hubert Chen"
name_list=full_name.split( )
greeting_list=("Hi, I'm X".split( ))
greeting_list[2]=name_list
greeting=" ".join(greeting_list)
1 Answer
Juan Martin
14,335 PointsHello my friend.
You're assigning all the name_list to greeting_list[2], the challenge states that you must assign "the first item in your name_list", so it must be name_list[0]. Here's how it should look:
full_name = "Hubert Chen"
name_list = full_name.split( )
greeting_list = "Hi, I'm X".split( )
greeting_list[2] = name_list[0] # I've changed name_list to name_list[0]
greeting = " ".join(greeting_list)
Hope this helps :)
hubert chen
12,761 Pointshubert chen
12,761 PointsThanks alot...been stuck for a while
Juan Martin
14,335 PointsJuan Martin
14,335 PointsNo problem my friend, I'm glad I could help you :)