function that counts...

Bryan bryanjugglercryptographer at yahoo.com
Tue May 25 19:40:26 EDT 2010


Raymond Hettinger wrote:
> If speed is important, the global lookups can be localized:
>
> def prttn(m, n, map=itertools.imap, int=int, str=str, range=range):
>     return sum(m == sum(map(int, str(x))) for x in range(n))

That's just silly. "If speed is important," we abandon the naive
algorithm.


--
--Bryan



More information about the Python-list mailing list