Skip to content

Instantly share code, notes, and snippets.

Created February 10, 2012 21:36
Show Gist options
  • Save anonymous/1793117 to your computer and use it in GitHub Desktop.
Save anonymous/1793117 to your computer and use it in GitHub Desktop.
Embedly problem 1 in python
import math
def sumAFactorial(number):
strn = str(number)
length = len(strn)
numsum = 0
for digit in range(0,length):
numsum += int(strn[digit])
return numsum
for n in range(1, 1001):
numsum = sumAFactorial(math.factorial(n))
if numsum == 8001:
print n
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment