define minus for lists python code example
Example 1: how to subtract 2 lists in python
[item for item in x if item not in y]
Example 2: subtract list from list python
>>> z = list(set(x) - set(y))
>>> z
[0, 8, 2, 4, 6]
[item for item in x if item not in y]
>>> z = list(set(x) - set(y))
>>> z
[0, 8, 2, 4, 6]