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

Great! Finally, make a variable named greeting where you join greeting_list back into a string, separated by spaces. You

help

greeting_list.py
full_name = "adrianne browning"
name_list = full_name.split()
greeting_list = "Hi, I'm Treehouse".split()
greeting_list[2] = name_list[0]

1 Answer

Stephen Bone
Stephen Bone
12,359 Points

HI Adrianne

By this point greeting_list should contain all of the required information so you now need to concatenate each item in the list putting a space in between each.

So you should end up with something like:

greeting = greeting_list[0] + " " + greeting_list[1] + " " + greeting_list[2]

Hope it helps!

Stephen

Kenneth Love
Kenneth Love
Treehouse Guest Teacher

Or you could just .join() them. greeting = ' '.join(greeting_list)

Stephen Bone
Stephen Bone
12,359 Points

Oh yeah! That's much better than my way :)

I totally forgot about using the join method like this. Perhaps it's time to review some lessons!