комбинируйте и если Python

[x for x in xyz if x not in a]
HosseinZaaferani