Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialArjan Guglani
3,598 PointsI 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
27,276 PointsHi 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.
Arjan Guglani
3,598 PointsArjan Guglani
3,598 PointsThanks very much!