Trailing zeros of 100!

Robin Koch robin.koch at t-online.de
Sat Jan 2 10:57:48 EST 2016


Am 02.01.2016 um 14:14 schrieb yehudak .:

> Thank you so much, but...
> All that is Chinese for me.
> Can you show a 'normal' Python code for me?

How about:

  >>> from math import log
  >>> sum([int(0.2**k*n) for k in range(1, int(log(n, 5))+1)])

}:-)

(That implements my procedure in my other answer.)

-- 
Robin Koch



More information about the Python-list mailing list