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

Kody Dibble
Kody Dibble
2,554 Points

Python Challenge 4/4

Not sure how to link the greeting_list back into the greeting variable?

greeting_list.py
full_name = "Kody Dibble"
name_list = str.split(full_name)
greeting_list = str.split("Hi, I'm Treehouse")
greeting_list[2] = name_list[0]
greeting = 
Michael Pastran
Michael Pastran
4,727 Points

Kody try using the .join() method for strings.

1 Answer

From what I gather you want to see the greeting variable contain the string "Hi, I'm Kody". You can use the string method join() which joins the list elements by the string calling the method. In this case the string with a single space will be calling the join method:

greeting = " ".join(greeting_list)

Does this answer your question?