Does '#hash' mean anything in IDLE?

Scott David Daniels scott.daniels at acm.org
Fri Mar 3 15:10:25 EST 2006


John Coleman wrote:
> Blackbird wrote:
>> I think this simpler version of letter_hash should work too:
>>
>> def letter_hash(word):
>>     w = [c for c in word]
>>     w.sort()
>>     return "".join(w)

And, for 2.4 or later:

     def letter_hash(word):
         return "".join(sorted(word))

sorted takes an iterable, and strings are iterables.

--Scott David Daniels
scott.daniels at acm.org



More information about the Python-list mailing list