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 trial

Python Python Basics (Retired) Shopping List Lists and Strings

Justin Kinney
Justin Kinney
445 Points

its saying name_list does not match my name..

help?

greeting_list.py
full_name = "JustinKinney"

name_list = list(full_name)

7 Answers

So 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
Justin Kinney
445 Points

it 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
Justin Carlson
12,755 Points

I think you need a space between your first and last name :-)

Justin Kinney
Justin Kinney
445 Points

how would I go about that? this is the only thing im confused on

You 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
Justin Kinney
445 Points

my qwas to charles and i tried that justin, it says name_list dose not match name

Justin Kinney
Justin Kinney
445 Points

srry i waset trying to be rude justin if it sounded tht way