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 trialJustin Kinney
445 Pointsits saying name_list does not match my name..
help?
full_name = "JustinKinney"
name_list = list(full_name)
7 Answers
Charlie L.
10,120 PointsSo what you're doing here is converting the string of "JustinKinney" to a list of ["JustinKinney"]. What you want to do is have a space in between your first and last name and find a way to split your name into two parts and then place those parts within a list.
Justin Kinney
445 Pointsit states create a var named full_name and set it to your full name, then create a var named name_list and set it to a list of your name and have itspaced
Justin Carlson
12,755 PointsI think you need a space between your first and last name :-)
Justin Kinney
445 Pointshow would I go about that? this is the only thing im confused on
Charlie L.
10,120 PointsYou could use the string.split() method to separate the first and last names. Make sure there is an empty space in between the first and last name within one string.
For example:
name = 'first last'
name_list = name.split(' ')
Justin Kinney
445 Pointsmy qwas to charles and i tried that justin, it says name_list dose not match name
Justin Kinney
445 Pointssrry i waset trying to be rude justin if it sounded tht way
Justin Kinney
445 Pointsit worked thnx