Fibonacci series recursion error

Chris Angelico rosuav at gmail.com
Mon May 2 02:30:53 EDT 2011


On Mon, May 2, 2011 at 4:28 PM, Chris Angelico <rosuav at gmail.com> wrote:
> reduce(`*,range(1,n+1))
> reduce(`*,xrange(1,n+1))

Whoops, forgot which language I was using. Back-tick functions not
being available, these need to be:

reduce(operator.mul,range(1,n+1))
reduce(operator.mul,xrange(1,n+1))

Chris Angelico



More information about the Python-list mailing list