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

Create a variable named full_name that holds your full name. Make another variable named name_list that holds your full.

Hi this is the question.

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!

I don't fully understand this, please help.

greeting_list.py
full_name = ("Adolf Percy Hitler")
name_list = []

   name_list.split():

2 Answers

Chris Adamson
Chris Adamson
132,143 Points

To create a list from the full_name, simply call split on the string full_name:

full_name = ("Adolph Percy Hitler") full_name 'Adolph Percy Hitler' name_list = full_name.split() name_list ['Adolph', 'Percy', 'Hitler'] type(name_list) <type 'list'>

thanks bro, i've done it now.

Hello,

Currently, you are trying to split the name_list. What you're wanting to be doing is splitting your full_name and storing those results in the name_list. Please let us know if this helps or if you need more assistance and we can help you further. Also, if you're needing more assistance, please provide your updated code so that we can help you from your current setup.

Also, you shouldn't need parenthesis around the string literal for your full name.