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

Ranko Milic
PLUS
Ranko Milic
Courses Plus Student 1,768 Points

When I try to replicate ' '.join(sentence_list) doesn't work in my Python Shell, there is an error message...

The error report is as follows: Traceback (most recent call last): File "<pyshell#8>", line 1, in <module> ' '.join(sentence_list) NameError: name 'sentence_list' is not defined

2 Answers

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,441 Points

The error NameError: name 'sentence_list' is not defined is literally saying that the variable sentence_list has not yet been defined in your Python shell. A previous statement is needed to define it.

If you thing you have previously defined sentence_list can you post that code?

Ranko Milic
PLUS
Ranko Milic
Courses Plus Student 1,768 Points

Yes, thanks, Chris, I have just discovered the same on my own few hours later... I have just missed to add that line to the code. Thank you for your reply and happy Christmas and New Year! :-)