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

greeting = greeting_list.join( )

Do you see my mistake?

greeting_list.py
full_name = "Cheri Watts"
name_list = full_name.split()
greeting_list = "Hi, I'm a Treehouse".split()
greeting_list[greeting_list.index("Treehouse")]=name_list[0]
greeting =greeting_list.join()

why does this line work? greeting_list(greeting_list.index("Treehouse".split()

full_name = "Cheri Watts" name_list = full_name.split() greeting_list = "Hi, I'm Treehouse".split() greeting_list[greeting_list.index("Treehouse")]=name_list[0] greeting =greeting_list.join

Frankly, I tried now the challenge and this line didn't work for me. It does work in python console but not in the challenge. To pass it I had to use:

full_name = "Cheri Watts"
name_list = full_name.split()
greeting_list = "Hi, I'm a Treehouse".split()
greeting_list = ("Hi, I'm {}".format(name_list[0])).split()
greeting = ' '.join(greeting_list)

Akak,

All the same, thank you for being a Hero! Not being able to move forward is so discouraging!

Cheri

2 Answers

greeting = ' '.join(greeting_list)

Kinda weird, I know ;)

You're welcome! :)