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 trialThomas Plans
1,198 PointsPlease 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!
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
104,132 PointsYour greeting
variable should be equal to the joined string for greeting_list
.
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
1,065 PointsHi (: 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
5,721 PointsTry 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))