[Tutor] Need help with Factorial algorithm using Python
Chris Fuller
cfuller084 at thinkingplanet.net
Fri Sep 5 03:37:35 CEST 2008
I spent the day mulling over this problem, and then implemented my solution
when I got home. This is for the easier problem of 7**8 zeros: On my linux
box, running something around 2 GHz, my script runs for about two minutes and
the answer is 23059225. You can verify your code to that. I checked that
the answer was correct for 7**2, 7**3, and 7**4.
My script is only 25-30 lines long. It isn't too complicated. The only place
I used strings was when verifying the length of trailing zeros, not in the
actual solution at all.
Cheers
More information about the Tutor
mailing list