I am trying to find all the items that are in list A and not in list B.
I thought something like newList = list(set(a) & !set(b)) or newList = list(set(a) & (not set(b))) would work, but it is not.
If there is a better way to achieve what I am trying to do other than this?
newList = [] for item in a: if item not in b: newList.append(item)
It is also important that this be done in Python 2.6
source share