Project Euler #20: Factorial digit sum

  • + 0 comments

    Almost a one-liner:

    from math import factorial
    
    for _ in range(int(input())):
        print(sum(int(d) for d in str(factorial(int(input())))))