1

2

3

# initialize manually

set

range

5

# initialize from iteratable

13

# add new element to set

13

# discard element from set

21

22

23

# update set with elements from iterable

# remove and return an arbitrary set element

2

1

2

3

# true if 2 in set

5

1

2

3

# true if 5 not in set

# test whether every element in a is in b

# issubset in operator form

# test whether every element in b is in a

# issuperset in operator form

# return the intersection of two sets as a new set

# return the difference of two or more sets as a new set

# difference in operator form

# return the symmetric difference of two sets as a new set

# return the union of sets as a new set

frozenset

# the same as set but immutable