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

Please Help Me My Code Is Not Working!

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

It says my greeting is not the right string!

greeting_list.py
full_name = "Thomas Plans"
name_list = full_name.split()
greeting = name_list [0]
greeting_list = "Hi, I'm {}".format(greeting).split()

3 Answers

Daniel Johnson
Daniel Johnson
104,132 Points

Your greeting variable should be equal to the joined string for greeting_list.

greeting_list.py
full_name = "Thomas Plans"
name_list = full_name.split()
greeting_list = "Hi, I'm {}".format(name_list[0]).split()
greeting = " ".join(greeting_list)
Katelyn Ma
Katelyn Ma
1,065 Points

Hi (: I'm not sure of the objective of your code, but it looks like you're trying to get it to say, "Hi, my name is Thomas?"

If so, then that would be:

full_name = "Thomas Plans"
name_list = full_name.split()
greeting = name_list[0]
print("Hi, I'm ",greeting)

If you're trying to do something else, let us know.

Aiman Hana
Aiman Hana
5,721 Points

Try this code :

full_name = "Thomas Plans" name_list = full_name.split() greeting = name_list [0] greeting_list = "Hi, I'm {}".format(greeting).split() print(" ".join(greeting_list))