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 trialAmel Eiland
303 Pointslists
I have been asked to create a new list by assigning 5 items to the variable colors. What I typed was: Colors= [red, blue, green, purple, orange]
What I get is an error: name 'red' is not defined
4 Answers
Anish Walawalkar
8,534 Pointsyou forgot the quotes:
colors = ['red', 'blue', 'green', 'purple', 'orange']
Amel Eiland
303 PointsLet's practice making a list. Make a new variable named colors. Assign it to a list of at least 5 items. They should be colors but I won't mark you off for that.
This is the challenge
Amel Eiland
303 PointsLet's practice making a list. Make a new variable named colors. Assign it to a list of at least 5 items. They should be colors but I won't mark you off for that.
This is the challenge
Anish Walawalkar
8,534 PointsAmel, I just did the challenge. look at my answer, you just forgot to put quotes around your color names. :)
Amel Eiland
303 PointsThank you so much Anish!!!
Haider Ali
Python Development Techdegree Graduate 24,728 PointsHi, I spotted two things wrong with your code. Your colors
variable starts with a capital letter and your colors are also not strings:
colors = ['red', 'blue', 'green', 'purple', 'orange']
Haider Ali
Python Development Techdegree Graduate 24,728 PointsHaider Ali
Python Development Techdegree Graduate 24,728 PointsCan you please link the challenge so i can help?