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

Making lists in python

are the following list1 and list2 equivalent? list1 = { "a", "b" } , list2 = [ "a", "b" ]

1 Answer

In your example, list1 is actually a set, and not a list (which you'll learn about in an upcoming course). List2 would be the proper syntax for creating a list.

thank you Matt! I was confused because both were accepted in the challenge but now I get it :)

Happy to help.