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

Matt Hanson
Matt Hanson
Treehouse Moderator 17,001 Points

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 :)