Find the sum of the digits in the number 100! (Python)

Find the sum of the digits in the number 100!
Find the sum of the digits in the number 100!

Python code to demonstrate a method to compute the factorial digists sum, i.e. 100 factorial (100!).

This test exercise I’ve recieved when I was looking for a Trainee Python Developer position.

n = 100
fact = 1
  
for i in range(1, n+1): 
    fact = fact * i

# Convert number to string
text_fact = str(fact)

# Initialize empty list for every letter of factorial string 
summ = []

for letter in text_fact:
    summ.append(int(letter))
print(sum(summ))
648

Автор Serhii Kupriienko

I have a multifaceted experience, accomplished several successful projects, including national-scale, modernized a museum, engaged in online commerce, wholesale and retail sales, was an entrepreneur, publisher, and editor. I headed the development department. I gave lectures and training. I organized events and press conferences. I was the secretary of the collegial boards. And I also did the planning and reporting in an organization. My Ph.D. thesis was “The social and economic system of the Inca Empire Tawantinsuyu“.

KUPRIENKO