Ver originaldef get_counter(l): return [(i, l.count(i)) for i in set(l)] get_counter(['a', 'a', 'b', 'c', 'c', 'c'])>>> [('a', 2), ('b', 1), ('c', 3)]