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!
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 trial
Create a variable named full_name that holds your full name. Make another variable named name_list that holds your full
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!
any suggestions? Thx
full_name = "peter gabriel" name_as_list = list(full_name) name_list = name_as_list ''.split(name_as_list)
Chris Shaw26,676 Points
To create a list using the
full_name variable you simply just need to pass a string to the
split method which consists of a space.
full_name = 'peter gabriel' name_list = full_name.split()
EDIT: updated as per Mr. Loves comment below :)