Returns the sum of the digits in the factorial of num >>> solution(100) 648 >>> solution(50) 216 >>> solution(10) 27 >>> solution(5) 3 >>> solution(3) 6 >>> solution(2) 2 >>> solution(1) 1
(num: int = 100)
| 29 | |
| 30 | |
| 31 | def solution(num: int = 100) -> int: |
| 32 | """Returns the sum of the digits in the factorial of num |
| 33 | >>> solution(100) |
| 34 | 648 |
| 35 | >>> solution(50) |
| 36 | 216 |
| 37 | >>> solution(10) |
| 38 | 27 |
| 39 | >>> solution(5) |
| 40 | 3 |
| 41 | >>> solution(3) |
| 42 | 6 |
| 43 | >>> solution(2) |
| 44 | 2 |
| 45 | >>> solution(1) |
| 46 | 1 |
| 47 | """ |
| 48 | nfact = factorial(num) |
| 49 | result = split_and_add(nfact) |
| 50 | return result |
| 51 | |
| 52 | |
| 53 | if __name__ == "__main__": |
no test coverage detected