Calculates the number of trailing zeroes on the end of x! when the user inputs x.
1 2 3 4 5 6 7 8 9 10 | def Trailing_Zeroes(x):
fives = 0
for number in range(2, x+1):
while number > 0:
if number % 5 == 0:
fives += 1
number = number/5
else:
break
return fives
|