Created
January 11, 2014 02:14
-
-
Save kaipakartik/8366145 to your computer and use it in GitHub Desktop.
2^15 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26. What is the sum of the digits of the number 2^1000?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = str(2 ** 1000) | |
print reduce(lambda x, y : int(x) + int(y), a) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using for