Computer Science, asked by Anonymous, 8 months ago

Write a program to find the number of trailing zeros (i.e. zeros at the end) in the factorial of 100.

Answers

Answered by saranshsharma255
2

Answer:

import math

from math import *

the_big_number = str(math.factorial(100))

the_big_list = list(the_big_number)

zeroes  = 0

for a in range(int(len(the_big_list)+1)):

   current_digit  = the_big_list[a]

   if(current_digit == '0'):

       zeroes += 1

print(zeroes)

Explanation:

i made a list out of the number and looped through it one digit at a time to count the number of zeroes

Similar questions