"William Witteman" <y...@nerd.cx> wrote
You need a loop, and putting a while True: around the whole thing
solves it nicely. Don't *call* the function again, just loop back
and do the operation again. That's what loops are for.
True, that's why my code currently looks like this:
Personally I don't think recursion is a problem in this context.
You would need a pretty dumb user to get it wrong 1000 times
(Pythons default recursion limit). So although a loop is the
more pythonic idiom a recursive solution here is fine in my
personal view.
But that may just be because I'm (yet again) playing with Lisp
and therefore thinking recursively about problems rather
than thinking loops.
:-)
--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/
_______________________________________________
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor