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

trouble naming lists

how do i add a name to my list on python

5 Answers

Hey munyaradzi! Im gonna assume that you mean how do you name a variable which contains a list? Like this:

myList = ["item1", "items2", "item3"]

yes that's exactly what I'm talking about

i keep trying to use that format but it keeps giving me this ÿellow or örange. What do I do?

yellow or orange? I dont understand. Can you elaborate? Maybe provide a screenshot

is this right ? colours =["yellow", "blue", "red"]

Yes that would indeed create a list containing the 3 string: "yellow", "blue", "red".

hey I keep getting a name error please help

Hey mund! I cannot help you if you dont provide updated code or screenshots. That being said if you've used the above code and your getting a name error, something is wrong, that something not being your code.. have you installed python on your computer? Are you trying this in a repl? Please provide more detail, and I'll be sure to help.