Welcome to the Treehouse Community
Looking to learn something new?
Anthony Macias11,220 Points
stuck on list challenge
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!
So.... what's your question?
name_list --> this should equal the first, middle and last name as list elements. However you shouldn't just type them in. That's so 1980's.
Check this out and see if you can apply it to your full_name variable.
<pre> >>> word = "This is some random text" >>> words2 = word.split(" ") >>> words ['This', 'is', 'some', 'random', 'text'] </pre>
You can use the split() method on your full_name variable.
Mark Long15,762 Points
The first challenge passed with:
full_name = "Steven Mark Long" name_list = full_name.split(" ")
Then when I attempted to answer the second challenge I received a message that says "Oops! It looks like Task 1 is no longer passing."
Daniel Chan11,787 Points
Yes you can do it simply like this:
full_name = 'Firstname Middlename Lastname' name_list = ' '.split(full_name) >>>name_list ['Firstname', 'Middlename', 'Lastname']