len([a[i] for i in range(len(a)) if not (a[i] in a[:i])])
>>> lst = [1, 2, 3, 1, 2, 3, 'a', 'b', 'a', 'b'] >>> len(set(lst)) 5 >>>