Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # #!/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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement