My question is different from removing duplicate
removing duplicate:
list_1 = [1, 2, 3, 4, 4, 3, 3, 7]
will become
you only keep one of the duplicated values
list_1 = [1, 2, 3, 4, 7]
My Question:
list_1 = [1, 2, 3, 4, 4, 3, 3, 7]
will become
you don’t keep any of the duplicated values
list_1 = [1, 2, 7]
>Solution :
The following will work:
list_1 = [1, 2, 3, 4, 4, 3, 3, 7]
res = [i for i in list_1 if list_1.count(i) == 1]
>>>print(res)
[1, 2, 7]