a = {'a', 'b', 'c'}
b = {'d', 'e', 'f'}
I want to add above two set values. I need output like
c = {'a', 'b', 'c', 'd', 'e', 'f'}
All you have to do to combine them is
c = a | b
Sets are unordered sequences of unique values. a | b
or a.union(b)
is the union of the two sets (a new set with all values found in either set). This is a class of operation called a "set operation", which Python set
s provide convenient tools for.