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

sharad kakran
PLUS
sharad kakran
Courses Plus Student 704 Points

Your name_list doesn't match your name!

i am continuously getting this error in the python basics midule

greeting_list.py
full_name = "shantu ga"
my_sentence = "shantuga"
my_sentence.split()
name_list = my_sentence.split()
' '.join(name_list)
Andrew Robinson
Andrew Robinson
16,372 Points

You need to call .split() on full_name, split uses spaces to determine where to split the string, in my_sentence there is no space.

1 Answer

hie sharad.

you didn't have to create the variable my_sentence because it now holds something different from the name in full_name. Just call .split() on full name like the question says. Calling split on my_sentence will not split your name on spaces because from what I see there are no spaces in my_sentence so just get rid of that other variable

full_name = "shantu ga"

name_list = full_name.split()