hdarwin

cstutoringcenter.com_Factorial Factorials

Jan 13th, 2013
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.17 KB | None | 0 0
  1. def factorial(n):
  2.     if n == 0: return 1
  3.     if n == 1: return 1
  4.     return factorial(n-1)*n
  5. sum = 0
  6. for x in str(factorial(100)):
  7.     sum += factorial(int(x))
  8. print sum
Advertisement
Add Comment
Please, Sign In to add comment