Hacker News new | ask | show | jobs
by aldanor 3878 days ago
Or this (not efficient but fun, and using a dict comprehension and no itertools):

    {a: sum(a == b for b in colors) for a in set(colors)}