Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Python Basics (2015) Python Data Types List Creation

add more items to your list??

why is this answer not working?

lists.py
colors = "red"
colg = "green"
colb = "blue"
colr = "red"
colbl = "black"
coly = "yellow"
colp = "pink"


listo1 =[]

listo1.append(colg)
listo1.append(colb)
listo1.append(colr)
listo1.append(colbl)
listo1.append(coly)
listo1.append(colp)
listo1.append(colors)

2 Answers

bryonlarrance
bryonlarrance
16,414 Points

The challenge is asking " Let'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." Something like this will get it to pass:

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

Gyorgy Andorka
Gyorgy Andorka
13,811 Points

Hi! colors should be the name of the list itself. Moreover, you don't have to add the items piece by piece, you can create a list like this: list_name = [item1, item2, item3, ...]