Python Python Basics (2015) Python Data Types List Creation

Arjan Guglani
Arjan Guglani
3,577 Points

I added lots of colors, but it is asking for more, what should I do?

I continue to add colors, only to be asked to add more!

lists.py
colors = ["blue, red, purple, brown, black, green, gray, violet, yellow, orange, tan, silver, pink, gold, bronze"]

1 Answer

Ryan S
Ryan S
27,257 Points

Hi Arjan,

As far as Python is concerned, you've only added one color. Everything between the quotes is a single string, no matter how many commas or words you have.

If you want more than one string in a list, you need to surround each item with quotes and separate them with commas.

Example:

colors = ["red", "blue", "green"]  # 3 list items

color = ["red, blue, green"] # 1 list item

Hope this helps.