MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / sum_of_digit_factorial

Function sum_of_digit_factorial

project_euler/problem_034/sol1.py:14–22  ·  view source on GitHub ↗

Returns the sum of the factorial of digits in n >>> sum_of_digit_factorial(15) 121 >>> sum_of_digit_factorial(0) 1

(n: int)

Source from the content-addressed store, hash-verified

12
13
14def sum_of_digit_factorial(n: int) -> int:
15 """
16 Returns the sum of the factorial of digits in n
17 >>> sum_of_digit_factorial(15)
18 121
19 >>> sum_of_digit_factorial(0)
20 1
21 """
22 return sum(DIGIT_FACTORIAL[d] for d in str(n))
23
24
25def solution() -> int:

Callers 1

solutionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected