Skip to content

Instantly share code, notes, and snippets.

@OscarGodson
Created June 27, 2014 05:43
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 OscarGodson/6ea65836f26c50712939 to your computer and use it in GitHub Desktop.
Save OscarGodson/6ea65836f26c50712939 to your computer and use it in GitHub Desktop.
def sum(a, b): return a + b
def stringSum(s):
numArray = list(str(s))
return reduce(sum, map(lambda s: int(s), numArray))
print stringSum(2**1000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment