On Thu, 27 Nov 2003, Andrew Koenig wrote: > --snip-- > Moreover, I don't know how to write an interative version that is as > easy to understand as the recursive version. ::Lurk mode off:: import math def numdigits(n): assert (n >= 0) and ((n % 1) == 0) if n < 10: return 1 return int(math.log10(n)) + 1 (not iterative, but it'll do :) ::Lurk mode on:: -- Devin devin at whitebread.org http://www.whitebread.org/
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4