This is a compressed version,if you see me post in link you see more how it works in part.
>>> from collections import Counter
>>> import random
>>> Counter(map(lambda x : 'even' if x % 2 == 0 else 'odd', (random.randint(0,1000) for i in range(100))))
Counter({'even': 58, 'odd': 42})