Sayth Renshaw writes: > Peter I really like this > > The complete code: > >>>> from collections import Counter >>>> def find_it(seq): > ... [result] = [k for k, v in Counter(seq).items() if v % 3 == 0] > ... return result
You confirmed to Chris that you want the item that occurs an odd number of times. The test for that is v % 2 == 1. Or just v % 2, given that 0 and 1 are considered false and true, resp. But v % 3 == 0 is something else. -- https://mail.python.org/mailman/listinfo/python-list