def histogram(s):
     """Takes a string s, returns a dictionary d of letters -> frequencies"""
     d = dict()
     for c in s:
          if c not in d:
               d[c] = 1
          else:
               d[c] += 1
     return d