Check out example codes for "python all elements not in list". It will help you in understanding the concepts better.

Code Example 1

[x for x in item if x not in z]

Learn ReactJs, React Native from akashmittal.com