A set is a special object that works similar to sets in mathematics. As such, all elements (values) in the set must be unique. Elements can be of a different types.
To create a set, you just define the variable name, and specify that it = set(), to create an empty set, or pass it a value. If you pass in a list, your set will contain each element of the list. If you pass in a string, it will separate the letters into the individual characters for the string to add to the set.
my_set = set() # creates an empty set
char_set = set('abc') # creates a set of a, b, c
char_set = set('aaabbbccc') # creates a set of a, b, c since elements cannot be duplicated
list_set = set([1,2,3]) # creates a list of 1,2,3
If you want to create a set of strings of words, you will need to put those words in a list, and then load the list.
words = ['one', 'two', 'three']
word_set = set(words)
Defining Python’s Set was originally found on Access 2 Learn