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,410 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,808 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, ...]