diff --git a/solutions/020/factorialdigitsum.py b/solutions/020/factorialdigitsum.py new file mode 100644 index 0000000..9764680 --- /dev/null +++ b/solutions/020/factorialdigitsum.py @@ -0,0 +1,11 @@ +factorial = 100 +product = 1 +sum = 0 + +for i in range(1, factorial + 1): + product *= i + +for i in str(product): + sum += int(i) + +print("The sum of the digits of " + str(factorial) + "! is " + str(sum)) \ No newline at end of file