Count trailing zeroes in factorial of a number | Function to return trailing 0 s in factorial of n ; Initialize result ; Keep dividing n by 5 & update Count ; Driver program
def findTrailingZeros ( n ) : NEW_LINE INDENT count = 0 NEW_LINE while ( n >= 5 ) : NEW_LINE INDENT n //= 5 NEW_LINE count += n NEW_LINE DEDENT return count NEW_LINE DEDENT n = 100 NEW_LINE print ( " Count ▁ of ▁ trailing ▁ 0s ▁ " + " in ▁ 100 ! ▁ is " , findTrailingZeros ( n ) ) NEW_LINE