You are viewing a single comment's thread. Return to all comments →
import math def Sum_of_digits(n: int)->int: res = math.factorial(n) digit_sum = sum(int(digit) for digit in str(res)) return digit_sum t = int(input()) for _ in range(t): N = int(input()) print(Sum_of_digits(N))
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #20: Factorial digit sum
You are viewing a single comment's thread. Return to all comments →