There are many ways to write a Python program that computes a histogram.
By histogram, I mean a function that counts the occurrence of objects in an iterable>
iterable>
For python 2.7, you can use this small list comprehension:
v = list('abracadabra') print {x: v.count(x) for x in set(v)}