Skip to content

Instantly share code, notes, and snippets.

@kaipakartik
Created January 11, 2014 02:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaipakartik/8366145 to your computer and use it in GitHub Desktop.
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?
a = str(2 ** 1000)
print reduce(lambda x, y : int(x) + int(y), a)
@reddy66666
Copy link

reddy66666 commented Feb 15, 2024

Using for

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment