Re:Ask HN: starting a career in software dev in my thirties,...
by ciupicri on Friday October 22, 2010 @11:34AM
(#1820025)
You don't need to do `list(s.lower())`, you can already iterate over a string. Also, instead of converting the whole string to a new lowercase one, which means allocating "a lot" of memory, you can convert each character separately as needed.
I'm going for 'a'.
And, according to http://en.wikipedia.org/wiki/File:English_letter_frequency_(... (via http://en.wikipedia.org/wiki/Letter_frequency) your four most frequently used letters match the table for English.
Tested in Python 2.7:
Edit: See my later response for something using the 'collections' module.