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 Wengroff
3,947 PointsCan't split a string
I do not understand why this is not the correct code here. The greeting_list variable is properly split, yet it's throwing me an error. Please let me know what is wrong. Thank you.
full_name = "Jake Wengroff"
name_list = full_name.split()
greeting_list = "Hi, I'm Treehouse"
greeting_list.split()
3 Answers
Bryan Laraway
13,366 PointsClose! Try this:
full_name = "Jake Wengroff"
name_list = full_name.split()
greeting_list = "Hi, I'm Treehouse".split()
p.s. I think the issue here is that you are creating the greeting_list variable as a string, and the grader/work checker is seeing the variable as a string instead of a list. If you instead split the string directly while creating the greeting_list variable, it should pass Task 2.
Jake Wengroff
3,947 PointsI actually got it to work soon after I submitted this question:
greeting_list = ("Hi, I'm Treehouse").split()
Thanks nonetheless!
MUZ141105 Shingirai Shoko
4,643 Pointsgreeting_list = "Hi, I'm Treehouse".split()