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 trial

Python Python Basics (2015) Python Data Types List Creation

python basics list says add more items

I'm trying to complete the challenge task 1 of 1 in the lists section of Python basics series. in that challenge it asks "Practice making a list, create a variable named colors and assign 5 colors to it" im entering colors= ["black, red, green, orange, blue"] and it keeps saying "add more items"

lists.py
colors = ['blue, red, orange, green, purple']

1 Answer

Vidhya Sagar
Vidhya Sagar
1,568 Points

The problem is where you have opened and closed the quotes .According to the complier you have a list which has only one string .You gotta do it like

colors = ['blue', 'red', 'orange', 'green', 'purple']

that makes sense, but i'm trying to do it exactly was instructed in the video. in the video, Kenneth creates a list as my_list = [1, 2, 3] why is this different?? Thank you for answering Vidhya!

Vidhya Sagar
Vidhya Sagar
1,568 Points

Strings have to be enclosed within quotes Martin. 1,2,3 are integers so quotes are not nessasary ,but colors are strings so quotes become mandatory .

that explains it all! sorry for the elementary question, still very new. I appreciate your quick response very much. Have a great New Year!