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

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!

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,276 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.