
Dustin Hicks
200 PointsI am trying to make a list variable. This is my code colors = [brown, blue, yellow, purple, red]. It gives me name error
It says brown is not defined
colors = [brown, blue, yellow, purple, red]
1 Answer

Jason Anders
Treehouse Moderator 144,840 PointsHi Dustin,
You are on the right track , but are missing something vital. Right now, the compiler is looking for variables with the names you have in the list. This is because there are no quotation marks around the words. Without quotation marks, the compiler thinks they are variable names and that is why you are getting the "not defined" error.
If you enclose each word in quotation marks, then that makes them Strings
.
I'm sure you'll pass it now.
Keep Coding! :)