
9.2
By:
dvdjaco on
Feb 18th, 2012 | syntax:
Python | size: 0.17 KB | hits: 20 | expires: Never
# #!/usr/bin/python
#
# By dvdjaco
# Exercise 9.1
#
def histogram(s):
d = dict()
for c in s: d[c] = d.get(c,0) + 1
return d
h = histogram('abcxxabcaba')
print h