Re: Project Euler 20.

2017-09-24 Thread Paul Rubin
Ian Kelly writes: sum(int(c) for c in str(math.factorial(100))) Doh! Using int(c) didn't occur to me and I didn't know about math.factorial. Notice also that WJ hasn't yet dared posting his crap on comp.lang.haskell. --

Re: Project Euler 20.

2017-09-24 Thread Ian Kelly
On Sun, Sep 24, 2017 at 4:35 PM, Paul Rubin wrote: > > "Robert L." writes: > >> Find the sum of the digits in the number 100! > > In Python? > > So you have come to plague us here too. > > >>> sum(ord(c)-ord('0') for c in str(reduce(lambda

Re: Project Euler 20.

2017-09-24 Thread Paul Rubin
"Robert L." writes: >> Find the sum of the digits in the number 100! > In Python? So you have come to plague us here too. >>> sum(ord(c)-ord('0') for c in str(reduce(lambda a,b: a*b, range(1,101),1))) 648 -- https://mail.python.org/mailman/listinfo/python-list