On 7 mai, 23:51, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: (snip)
Small improvement thanks to Paul Rubin:
from collections import defaultdict
from operator import itemgetter
def get_letters_frequency(source):
letters_count = defaultdict(int)
for letter in source:
letters_count[letter] += 1
return sorted(
letters_count.iteritems(),
key=itemgetter(1),
reverse=True
)
--
http://mail.python.org/mailman/listinfo/python-list
