From Bistre Earthworm, 3 Months ago, written in Text.
Embed
  1. def mapMe(s):
  2.     D = {}
  3.     for i in s:
  4.         D[ord(i)%32] = D.get(ord(i)%32,[])+[str(i)]
  5.     t = ','.join( '%d:[%s]'%(i,','.join(D[i])) for i in sorted(D.keys()))
  6.     return '['+t +']'