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 trial

Python Python Basics (2015) Python Data Types List Creation

jamie Macdiarmid
jamie Macdiarmid
2,048 Points

Can 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.

lists.py
my_list= [red, yellow, green, blue, orange]

4 Answers

Grigorij Schleifer
Grigorij Schleifer
10,365 Points

Hi jamie,

try this:

colors = ["Red", "Yellow", "Blue", "Green", "Purple"]

Grigorij

jamie Macdiarmid
jamie Macdiarmid
2,048 Points

Hi. Thanks Grigorij. Forgot to put each color in "". Is that because I have to define each color?

Grigorij Schleifer
Grigorij Schleifer
10,365 Points

Hey,

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
jamie Macdiarmid
2,048 Points

Thanks again. sometimes you feel like eating your own neck!!

Grigorij Schleifer
Grigorij Schleifer
10,365 Points

I think this is something you need to hammer all this crazy programming stuff into your brain :)

Keep on hammering Pythonista !

The video does not show needing the " for each word.

Matthew Goldenberg
Matthew Goldenberg
3,096 Points

This 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?