Make 2 sets out of sequences: Intersection, Union, Difference
X = set('spam')
Y = set(['h', 'a', 'm']) # Make 2 sets out of sequences
print X, Y
print X & Y # Intersection
print X | Y # Union
print X - Y # Difference
Related examples in the same category