Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Python Basics (Retired) Shopping List Lists and Strings

Kody Dibble
Kody Dibble
2,554 Points

Python Challenge

I'm not sure what to do for the rest of these steps, not sure what it's asking or the syntax?

full_name = "Kody Dibble":
name_list = (

3 Answers

Devin Bartley
Devin Bartley
2,800 Points

Hi Kody,

Sometimes it takes a bit to really understand what the challenge is looking for.

I would start out by defining your name as a string variable, which you have already done. Please note that in the first line of your code you should delete the colon since it doesn't belong there.

Now you will want name_list to be the full_name variable you already defined but split. Remember the str.split() function will split up a string on the spaces. you will want to put the full_name string inside the function so it knows that it will split that string.

Here is how I got to the challenge to work.Try it out in the workspaces one step at a time and print out the variables to check what it is giving you as output.

full_name = "Devin Bartley"

name_list = str.split(full_name)

Blaise Gratton
Blaise Gratton
30,212 Points

So you have a variable, full_name, which references a string ("Koby Dibble"). You want to store that string split up into a list into the variable name_list. So, name_list would return a list like this:

["Koby", "Dibble"]

See if you can call the right method on full_name to produce a list like this.

Hey Kody Dibble ,

Could you post the important part or entire question for the challenge? This will speed up the process in helping you find an answer.