A set is an unordered collection with no duplicate items in Python. In this lesson, you will learn how to create them, and perform basic operations to determine members in the set and compare the values from different sets.
# create a set animals = {'dog', 'cat', 'bird'} # create an empty set foo = set() # add value to set foo.add('bar') # remove value from set foo.remove('bar') fish = {'wheel'} # merge set t = animals.union(fish)