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 trialViraj Kokane
17,531 PointsPlease help! Having trouble with code.
Having trouble with the code. Please help. Any help would be appreciated.
3 Answers
Steve Hunter
57,712 PointsHave a try with this:
full_name = "Steve Hunter"
name_list = full_name.split()
Steve.
Steve Hunter
57,712 PointsMake sure you use the brackets - they don't apear clearly in the code snippet but they're there!!
Viraj Kokane
17,531 Pointsfull_name = "Viraj Kokane" name_list = full_name.split() greeting_list = "Hi, I'm Treehouse".split() name_list.append(greeting_list[3])
Viraj Kokane
17,531 PointsPlease help with this 3rd challenge!
Steve Hunter
57,712 Pointsfull_name = "Steve Hunter"
name_list = full_name.split()
greeting_list = "Hi, I'm Treehouse".split()
greeting_list[2] = name_list[0]
:-)
Viraj Kokane
17,531 PointsThank you Steve Hunter very much for the help! :)
Steve Hunter
57,712 PointsNo problem!
Steve.
Steve Hunter
57,712 PointsAnd the last part is a little strange. To join a list back together, start with the 'delimiter', i.e. the string that you want to separate the items in the list once you've joined it together. A space is common, for obvious reasons! Then call the join
method on that string, passing the list as a parameter:
greeting = " ".join(greeting_list)
Viraj Kokane
17,531 PointsViraj Kokane
17,531 Pointsfull_name = "Viraj Kokane" name_list = list(full_name.split)