Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.071 X-Spam-Evidence: '*H*': 0.86; '*S*': 0.00; 'be:': 0.09; 'pm,': 0.11; 'subject:error': 0.12; 'wrote:': 0.14; 'skip:r 30': 0.19; 'language': 0.20; 'header:In-Reply-To:1': 0.22; 'mon,': 0.22; 'chris': 0.27; 'message-id:@mail.gmail.com': 0.28; 'forgot': 0.29; 'to:addr:python-list': 0.32; 'received:209.85': 0.37; 'received:google.com': 0.38; 'to:addr:python.org': 0.39; 'received:209': 0.39; 'header:Received:5': 0.40; 'available,': 0.60; '2011': 0.62; 'received:209.85.210.174': 0.84; 'received :mail-iy0-f174.google.com': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=sWuktXg+Hga+NqUOuwMGtblxCNJVW+ZfkZpTXNeUU14=; b=QqNcZfUV2JVQghmWJm5D75mM/ymMhDlMYncN88xTRjTXpTQLUiWKlA4DmsoKVOZMO/ AqcW3BOxzAejjOOGR62b4XAKHrkToTHRSOMs6NqyrUlsxrqic053Zwy5dY98cJ+c+Qr/ amOArVarduU0JPe5OJHK7vG9gQAZYvepZVlO4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=GAmaIacc9g3SYrId6Jh58U3fkyu8AbUl2sTgGy0hNa/yDlrgvccpHVH7kDu+sIRyYa hEF1y0ylaoPhgX4bHlFR9DmUBdifM+r/pVzKgTvDsXINeCkn9yPHTkL0HL+wYRnwNejR gX4/cwsE6LNOYzcHf9XyfA0kQWLWyJho7+ego= MIME-Version: 1.0 In-Reply-To: References: <87iptw1egh.fsf@rudin.co.uk> <87ei4k0ygz.fsf@rudin.co.uk> <87aaf7246f.fsf@rudin.co.uk> <4dbd221a$0$29991$c3e8da3$5496439d@news.astraweb.com> <4dbd4a88$0$29991$c3e8da3$5496439d@news.astraweb.com> <6fs198-8lf.ln1@svn.schaathun.net> Date: Mon, 2 May 2011 16:30:53 +1000 Subject: Re: Fibonacci series recursion error From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 11 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1304317855 news.xs4all.nl 41103 [::ffff:82.94.164.166]:48405 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:4442 On Mon, May 2, 2011 at 4:28 PM, Chris Angelico 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