>>>x = set('runoob') >>>y = set('google') >>>x, y (set(['b', 'r', 'u', 'o', 'n']), set(['e', 'o', 'g', 'l'])) # delete duplicated items >>>x & y # return the same items in both set set(['o']) >>>x | y # return all the items set(['b', 'e', 'g', 'l', 'o', 'n', 'r', 'u']) >>>x - y # like difference set(['r', 'b', 'u', 'n'])