def dictAsString(d):
 s = '{'
 for (key, val) in sorted(d.items()):
  s += ('%s: %s, ' % (key, val))
 s = s.rstrip(', ')
 s += '}'
 return s

def dictAsString ( d ) : s = '{' for ( key , val ) in sorted ( d . items ( ) ) : s += ( '%s: %s, ' % ( key , val ) ) s = s . rstrip ( ', ' ) s += '}' return s
helper function that returns a string representation of a dictionary .