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 > Stage 2 > List Creation

Q: "Let's practice making a list. Make a new list variable named 'colors.' Fill it with at least 5 items. They should be colors but I won't mark you off for that."

Stuck on this part... can someone please help? Thanks!

3 Answers

I am not sure what part of this task you are specifically stuck on, but your answer should look something like this:

colors = ["red", "blue", "green", "orange", "yellow"]

Hi, Ahmed!

To create a list, all you need to do is:

list_name = ["A", "List", "Contains", "Several", "Different", "Strings"]

As you can see, a list is basically just a set of values put together in a certain order and separated by commas. And, the values can be more than just strings. They could be booleans, ints, other lists, etc..

If you are ever have a question make sure you watch the video again too!

Hope this helps!

Thank you so much, guys!

I think the error I was receiving may have something to do with my placement of the commas ["red," "blue," "green," "orange," "yellow"].