[New-bugs-announce] [issue7369] Fibonacci example does not include 0; section 4.6

prm225 report at bugs.python.org
Fri Nov 20 14:50:32 CET 2009


New submission from prm225 <prm225 at gmail.com>:

The example starts off with 1 being printed, while the series is 
expected to begin with 0 and 1.
The example in 4.6 (defining functions) should have been:

def fib(n):
  a, b = 0, 1
  while a < n:
    print a,
    a, b = b, a+b
fib(2000)

0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597

----------
assignee: georg.brandl
components: Documentation
messages: 95542
nosy: georg.brandl, prm225
severity: normal
status: open
title: Fibonacci example does not include 0; section 4.6
versions: Python 2.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7369>
_______________________________________


More information about the New-bugs-announce mailing list