Python Python Basics (2015) Python Data Types List Creation

Arjan Guglani
Arjan Guglani
3,598 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!
colors = ["blue, red, purple, brown, black, green, gray, violet, yellow, orange, tan, silver, pink, gold, bronze"]

1 Answer

Ryan S
Ryan S
27,262 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.


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

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

Hope this helps.