way to calculate 2**1000 without expanding it?

Prasad, Ramit ramit.prasad at jpmorgan.com
Fri Sep 16 17:13:38 EDT 2011


>>> sum(map(int,str(2**1000)))
*smacks face* Gah, forgot about sum.

Ramit


Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423



This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  


More information about the Python-list mailing list