Edit:
I'm sorry, I misread your question originally.
What you really want is collections.Counter
and a list comprehension:
>>> from collections import Counter
>>> li= [11, 11, 2, 3, 4]
>>> [k for k, v in Counter(li).iteritems() if v == 1]
[3, 2, 4]
>>>
This will only keep the items that appear exactly once in the list.
If order does not matter, then you can simply use set
:
>>> li = [11, 11, 2, 3, 4]
>>> list(set(li))
[3, 2, 11, 4]
>>>
Otherwise, you can use the .fromkeys
method of collections.OrderedDict
:
>>> from collections import OrderedDict
>>> li= [11, 11, 2, 3, 4]
>>> list(OrderedDict.fromkeys(li))
[11, 2, 3, 4]
>>>