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

Python shopping_list Challenge confusion

I believe I'm just getting caught in the language, but is He looking for a for0 in() statement on the next step? Where Treehouse is replaced with the first item on the name list?

greeting_list.py
full_name = ("Mary Kate Vieux")
name_list = full_name.split( )
greeting_list = ("Hi, I'm Treehouse.".split( ))

3 Answers

Basically what the task is asking you to do is to replace "Treehouse" with the first word (item) of your name (which you have saved in the full_name variable).

Right now your lists look like:

full_name --> ['Mary', 'Kate', 'Vieux']

greeting_list --> ['Hi,', 'I'm', 'Treehouse']

So the task wants you to make greeting_list look like:

['Hi,', 'I'm', 'Mary']

To do this you need to replace the 3rd item of the greeting_list with the 1st item of the full_name, which is pretty straight-forward.

greeting_list[2] = name_list[0]

Hope that helps. Good luck!

PS: You don't need to wrap parenthesis around the string variables. For example full_name = ("Mary Kate Vieux") should just be full_name = "Mary Kate Vieux"

How does one mark something as solved? blush

full_name = (Beven Nyamande)
name_list = [full_name.split()]
greeting_list = ("Hi i'm {}".format(name_list[0]))

Thanks so much for the hasty reply. I see I'm still adding in javascript bits where they shouldn't be as well. :) Funny how simple it is when pointed out. Cheers.