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

keith kearse
keith kearse
274 Points

How to change the name of list variable?

In the previous video it showed that you make a list as such: "My_list=[1,2,3,4]". Is there another way to type the Variable to make it say Colors?

lists.py
list_colors=[red,green,purple,blue,pink]

1 Answer

Ben Reynolds
Ben Reynolds
35,170 Points

Yes, you've got the right idea just make sure if you're storing a collection of string values to put each one in quotes.

keith kearse
keith kearse
274 Points

thank you, i also realized that i don't need to add "List" to make it into a list, The brackets are what identify it as a list.

Facepalming myself