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 trialJake Nisenboim
3,374 PointsPython Help
My code is
full_name = "Jake Zeal"
name_list = full_name.split()
greeting_list = "Hi, I'm {}".format(name_list[0]).split()
greeting = "{}".format(greeting_list).join()
But it does not pass.
Thanks.
1 Answer
Seth Kroger
56,413 PointsKeep task 2 and 3 on separate lines. You also shouldn't need format() because the string for join() in step 4 should only be what goes between list items. join() will do the rest.
# task 1
full_name = "Seth Kroger"
name_list = full_name.split()
# task 2
greeting_list = "Hi, I'm Treehouse".split()
# task 3
greeting_list[-1] = name_list[0] # or greeting_list[2] but I like the last item syntax better.
# task 4
greeting = " ".join(greeting_list)
Jake Nisenboim
3,374 PointsAwesome thanks ! I will try it out now
Jake Nisenboim
3,374 PointsJake Nisenboim
3,374 PointsOr step 3 would be something like:
However greeting_list is not yet defined. Hmmm