[Tutor] recursion depth
Keith Winston
keithwins at gmail.com
Wed Jan 8 21:25:50 CET 2014
I've been playing with recursion, it's very satisfying.
However, it appears that even if I sys.setrecursionlimit(100000), it blows
up at about 24,000 (appears to reset IDLE). I guess there must be a lot of
overhead with recursion, if only 24k times are killing my memory?
I'm playing with a challenge a friend gave me: add each number, up to 1000,
with it's reverse, continuing the process until you've got a palindrome
number. Then report back the number of iterations it takes. There's one
number, 196, that never returns, so I skip it. It's a perfect place to
practice recursion (I do it in the adding part, and the palindrome checking
part), but apparently I can't help but blow up my machine...
--
Keith
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20140108/0ca96485/attachment.html>
More information about the Tutor
mailing list