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 trialShayler White
104 PointsNameError
Why is my name 'name' incorrect? I did it exactly as the video showed.
2 Answers
josephchemaly
2,914 PointsJust type:
name = "name"
It has to have quotes around it so that python knows that it is a string. Strings are basically words, sentences or paragraphs. Just think of strings as letters and spaces tied together to make a sentence or a word.
Evan Demaris
64,262 PointsHi Shayler,
It sounds like you entered:
name = name
In Python, this is the equivalent of saying that you want to assign the variable called name
to the variable called name
. Or to be more clear, name = Shayler
would tell Python you are assigning the variable called Shayler
to the variable called name
.
You need to surround strings with quotation marks so that Python understands that you're referencing a string, not a variable. In this instance, you'd pass with:
name = "name"
or alternatively;
name = 'name'
Chris Freeman
Treehouse Moderator 68,441 PointsWhy was this down voted?
Chris Freeman
Treehouse Moderator 68,441 PointsChris Freeman
Treehouse Moderator 68,441 PointsCan you post your code?