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

tonton lyfe
tonton lyfe
892 Points

Challenge Task 4 of 4 str.join()

please help

greeting_list.py
full_name = "M A N"
name_list = full_name.split()
greeting_list = ("Hi, I'm {}".format(full_name)).split()
greeting = " ".join(greeting_list)

2 Answers

Here, try this:

full_name = "Adam Sandler"
name_list = full_name.split()

greeting_list = "Hi, I'm Treehouse".split()
greeting_list[2] = name_list[0]
greeting = " ".join(greeting_list)

I think the issue is that task 3 asked you to swap 'treehouse' for the first item of the name list, which I did using list indices. Other than that, your code looks fine!

The challenge asks you to add just the first element of

name_list

to the string that you split into

greeting_list,

and you're presently using your full name. Fix that and it should work.