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 trialCheri Nadell
2,954 PointsI cannot get past the code challenge for 1 of 4 regarding lists. I need help please.
The task is: “Create a variable named full_name that holds your full name. Make another variable named name_list that holds your full name as a list, split on the spaces. Don't create name_list manually!” I wrote:
full_name = "Deborah Anne Winger"
name_list = []
name_list.append(full_name)
which resulted in:
['Deborah Anne Winger']
I’m being told that my name_list doesn’t match my name. I don’t see how that’s true. What am I missing here? Help.
4 Answers
Jason Anello
Courses Plus Student 94,610 PointsHi Cheri,
You're not splitting the name up along the spaces.
The result you're trying to get is this: ['Deborah', 'Anne', 'Winger']
There's a .split()
method you can use on full_name
to split it.
Let me know if you need further help.
Sean T. Unwin
28,690 PointsYou want to use split()
in order to "split on the spaces" as the challenge requests.
name_list = full_name.split(' ')
Cheri Nadell
2,954 PointsThank you.
Cheri Nadell
2,954 PointsThank you.