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 trialNvm Changed
68 PointsI don't understand what the mistake it is in this: (python lists creation)
colors_list = [1, 2, 3, 4, 5] The program says: NameError: 'colors' is undefined.
qcolors_list = [1, 2, 3, 4, 5]
2 Answers
Ezra Siton
12,644 PointsCreate var named colors (You wrote "colors_list") + add strings items (not numbers)
Example:
colors = ['blue', "orange", "black", "yellow", 'gray']
Samuel Ferree
31,722 Pointscan you post your whole code?
The text in your post defines a list names colors_list and the code you posted defines a list name qcolors_list but the error seems like you used a variable name colors somewhere in your code.
Maybe the challenge is expecting colors, and you have to define it... maybe just take list off your variable name then?
colors = ['red','blue','green']
Nvm Changed
68 PointsNvm Changed
68 PointsI mistakenly added a q before colors there so please ignore it