a = [[1, 2], [1, 3], [1, 4], [1, 2], [1, 4], [1, 2]] print list(set(tuple(i) for i in a))
A task is being performed on one liner.
user $ time python foo.py
[(1, 2), (1, 3), (1, 4)]
real 0m0.037s
user 0m0.024s
sys 0m0.010s
For printing only unique user-defined items. The solution is a variant of the Amber solution, except that I do not use the collection module.
a = [[1, 2], [3, 4], [1, 3], [1, 4], [1, 2], [1, 4], [1, 2]] d = {tuple(i): a.count(i) for i in a} print [k for k, v in d.iteritems() if v == 1]
Output:
[(1, 3), (3, 4)]