I've written a program to check if my thought about solution on paper is right (and it is).
The task: how many zeros is in the back of multiplication of all numbers from 10 to 200.
It is 48 and it is a simple to calculate manually.
I never write on python seriously and this is what I get:
mul = 1
for i in range(10, 200 + 1):
mul *= i
string = str(mul)
string = string[::-1]
count = 0;
for c in str(string):
if c == '0':
count += 1
else:
break
print count
print mul
I bet it is possible to write the same more elegant in such language like a python.
ps: yes, it is a homework, but not mine - i just helped a guy ;-)