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 trialjamie Macdiarmid
2,048 PointsCan someone remind show me?
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.
my_list= [red, yellow, green, blue, orange]
4 Answers
Grigorij Schleifer
10,365 PointsHi jamie,
try this:
colors = ["Red", "Yellow", "Blue", "Green", "Purple"]
Grigorij
jamie Macdiarmid
2,048 PointsHi. Thanks Grigorij. Forgot to put each color in "". Is that because I have to define each color?
Grigorij Schleifer
10,365 PointsHey,
you need " " for every word, so it can be recognised as a string. And the colors will represented as Strings here, so you are right
jamie Macdiarmid
2,048 PointsThanks again. sometimes you feel like eating your own neck!!
Grigorij Schleifer
10,365 PointsI think this is something you need to hammer all this crazy programming stuff into your brain :)
Keep on hammering Pythonista !
Jeremy Proffitt
1,246 PointsThe video does not show needing the " for each word.
Matthew Goldenberg
3,096 PointsThis is over a year late, but hopefully helpful to somebody. I believe (and could be mistaken) that "" is only necessary for anything that is NOT an integer. The lists in the video were all integers [1, 2, 3, 4, 5].
Can somebody confirm or reject this?