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

Problem Lists and Strings Objectives Oops !

I'm sorry, but I can't finish this exercise... I barely understand what I've to do (english isn't my first language) so it's becoming quite complicated ! If someone can explain me where I'm wrong in my code :D !

Here are the instructions : "Great! Finally, make a variable named greeting where you join greeting_list back into a string, separated by spaces. You should end up with "Hi, I'm <your first name>" as the value of greeting."

greeting_list.py
full_name = "Lucie Drouet"

name_list = full_name.split()



greeting_list = ["Hi, I'm Lucie Drouet"].split()

greeting = ' '.join(greeting_list)

2 Answers

akak
akak
29,445 Points

You need to modify greeting_list. The rest of your code is OK ;)

greeting_list = "Hi, I'm {}".format(name_list[0]).split() 

Thank you again ! ;) not so easy...

akak
akak
29,445 Points

You're welcome :) I have to admit that Python challenges are the most difficult from those I've encountered on Treehouse. But on the other hand I think I learn the most from that approach.