way to calculate 2**1000 without expanding it?

Ian Kelly ian.g.kelly at gmail.com
Fri Sep 16 16:20:46 EDT 2011


On Fri, Sep 16, 2011 at 2:17 PM, Arnaud Delobelle <arnodel at gmail.com> wrote:
> Ah go on, let's make a codegolf contest out of it.
> My entry:
>
>>>> sum(map(int,str(2**1000)))
> 1366

That is exactly what mine was.



More information about the Python-list mailing list