from functools import reduce def factorial(n): if 1 == n: return 1 return n * factorial(n - 1) print(reduce(lambda x, y: x + int(y), str(factorial(100)), 0))