## 交集（Intersection）

>>> a = [1, 2, 3, 4, 5, 6]
>>> b = [2, 4, 6, 8 ,10]
>>> a and b
[2, 4, 6]


intersection = list(set(a).intersection(b))

intersection = list(set(a) & set(b))

intersection = [x for x in b if x in set(a)]   # list a is the larger list b

intersection = list((set(a).union(set(b)))^(set(a)^set(b)))

## 并集（Union）

>>> a = [1, 2, 3, 4, 5, 6]
>>> b = [2, 4, 6, 8 ,10]
>>> a or b
[1, 2, 3, 4, 5, 6, 8, 10]


union = list(set(a) | set(b))

list(set(a).union(set(b)))

## 差集（Difference Set）

>>> a = [1, 2, 3, 4, 5, 6]
>>> b = [2, 4, 6, 8 ,10]
>>> a or b
[1, 2, 3, 4, 5, 6, 8, 10]


difference = list(set(b).difference(set(a)))    # elements in b but not in a
difference = list(set(a).difference(set(b)))    # elements in a but not in b


difference = list(set(a_list)^set(b_list))

difference = list(set(a)-set(b))    # elements in b but not in a
difference = list(set(a)-set(b))    # elements in a but not in b


difference = [x for x in b if x not in set(a)]    # elements in b but not in a
difference = [x for x in b if x not in set(a)]    # elements in a but not in b