+ 2
How do you differentiate between declaring an empty dictionary and an empty set?
(sorry I meant set all along)
3 Answers
+ 1
still learning, but wouldn't it be:
dictionary= {}
list = []
edit: based on your edit, you want empty set not empty list, from what I read there is no set literal defined like there is for dictionary, tuples, & lists. You would write:
mySet = set()
+ 1
A little correction to @Colin information, empty sets are not defined with brackets, but rather curly brackets with the name set prepended as below:
For dictionary
my_dictionary = {}
For set
my_set = set{}
0
@jake not sure, but isn't a list an array (and a list nested in a list a more - dimensional array)?