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 trialjedd marras
Courses Plus Student 346 PointsLists
Hi I'm having trouble answering this question:
Make a new list variable named colors. Fill it with at least 5 items. They should be colors but I won't mark you off for that.
My answer, which is wrong:
colors = [green,yellow,pink,red,brown]
colors = [green,pink,yellow,orange,green]
2 Answers
Sebastian Rother
6,715 PointsJust add quotes:
colors = ['green', 'pink', 'yellow', 'orange', 'green']
Happy coding
Michael Barlow
34,317 PointsTo add to Sebastian's answer, jedd marras, the items in your list are undefined identifiers, and the question was looking for a list of strings. If you assigned strings to each one of the identifiers (e.g. green = 'green'
) prior to creating the list, then your answer would technically be correct.