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
munyaradzi kakora
2,944 Pointstrouble naming lists
how do i add a name to my list on python
5 Answers
behar
10,800 PointsHey munyaradzi! Im gonna assume that you mean how do you name a variable which contains a list? Like this:
myList = ["item1", "items2", "item3"]
munyaradzi kakora
2,944 Pointsyes that's exactly what I'm talking about
munyaradzi kakora
2,944 Pointsi keep trying to use that format but it keeps giving me this ÿellow or örange. What do I do?
behar
10,800 Pointsyellow or orange? I dont understand. Can you elaborate? Maybe provide a screenshot
munyaradzi kakora
2,944 Pointsis this right ? colours =["yellow", "blue", "red"]
behar
10,800 PointsYes that would indeed create a list containing the 3 string: "yellow", "blue", "red".
munyaradzi kakora
2,944 Pointshey I keep getting a name error please help
behar
10,800 PointsHey 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.