feat(solution): problem #20
parent
b8b26086a1
commit
74761d4ce3
|
|
@ -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))
|
||||||
Loading…
Reference in New Issue