On 27 Okt., 10:27, Arnaud Delobelle <[email protected]> wrote: > True. It's far too verbose. I'd go for something like: > > f=lambda n:n<=0 or n*f(~-n) > > I've saved a few precious keystrokes and used the very handy ~- idiom!
You can replace "n<=0" with "n<1". Then you can leave out the space
before "or" ("0or" wouldn't work with newer python versions).
f=lambda n:n<1or n*f(~-n)
Much better, isn't it? ;-)
--
http://mail.python.org/mailman/listinfo/python-list
