Skip to content
Advertisement

Python counting the trailing zero of factorial

Working on an example but it does not work. There must be a function which counts trailing zero in n! the factorial formula. where, n is the number for whose factorial we want to find the number of trailing zeros. Used some imports but it did not work.

My code:

JavaScript

Ex:

JavaScript

Output must be:

JavaScript

Advertisement

Answer

This code can do the job, your code is very complex.

JavaScript

Output:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement