Python Python Basics (2015) Python Data Types List Creation

Daniel Amini
Daniel Amini
200 Points

Making a list of colors

I just watched the lesson on making lists. The example in the lesson was a list of numbers which apparently is easier than a list of colors.

The challenge is the list of colors... I am receiving a name error.

I also attempted jut the first part of variable = "colors" and I was prompted with the error of "colors not defined"

Is there anywhere on this site where I can find an answer sheet so I don't have to use this question feature every time?

lists.py
varialble = "colors"

colors = [red, blue, black, green, brown]

1 Answer

bryonlarrance
bryonlarrance
16,413 Points

In python there isn't a need to declare a variable. For instance, just label the list and that label becomes the variable.

colors = []

Also, words inside of a list are strings and need quotation marks around them (single or double are cool)