In Python you can use a.intersection(b) to find the items common to both sets.
a.intersection(b)
Is there a way to do the disjoint opposite version of this? Ite
Try this code for (set(a) - intersection(a&b))
a = [1,2,3,4,5,6] b = [2,3] for i in b: if i in a: a.remove(i) print(a)
the output is [1,4,5,6] I hope, it will work
[1,4,5,6]