top of page

Factorial Digit Sum

5 days ago

1 min read

0

4

0


Consider the number 100!

That is the product of all of the numbers between 1 and 100.

That is to say, 1 x 2 x 3 ... x100.

Project Euler has tasked us with providing the sum of the digits of that number.


The first thing to do is to use the math library and the factorial function to generate the number.

Following that we need to initialise a list and write each individual digit as a member of the list.

Then, we just wrap that in a sum(list) and the print the answer out.

Quite a simple one today.


5 days ago

1 min read

0

4

0

Comments

Share Your ThoughtsBe the first to write a comment.
bottom of page