Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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?

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.