[issue7369] Fibonacci example does not include 0; section 4.6

2009-11-23 Thread Mark Dickinson
Mark Dickinson added the comment: Fixed in r76460 through r76463. -- resolution: -> fixed status: open -> closed versions: +Python 2.7, Python 3.1, Python 3.2 ___ Python tracker ___

[issue7369] Fibonacci example does not include 0; section 4.6

2009-11-22 Thread Senthil Kumaran
Senthil Kumaran added the comment: Terry: Oh, sorry. Now I get what you meant by "Prepend O to output line". That is, Output line from the fib, as part of the patch. The changes need to be done at 3 places. Section 3.2, twice in Section 4.6. -- ___

[issue7369] Fibonacci example does not include 0; section 4.6

2009-11-22 Thread Terry J. Reedy
Terry J. Reedy added the comment: Senthil: look again. The OP's suggestion *is* to prepend a 0 to the current 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 I just specified the delta between current and suggested, should someone decide to make the change. That said, def fib2(n), a little

[issue7369] Fibonacci example does not include 0; section 4.6

2009-11-22 Thread Senthil Kumaran
Senthil Kumaran added the comment: tjreedy: The reporter's suggestion seems fine. Prepending a 0 does not seem to be a good idea. -- nosy: +orsenthil ___ Python tracker ___ _

[issue7369] Fibonacci example does not include 0; section 4.6

2009-11-20 Thread Terry J. Reedy
Terry J. Reedy added the comment: The delta (patch) is to change 'b' to 'a' in the while and print statements and prepend '0 ' to the output line. -- nosy: +tjreedy ___ Python tracker __

[issue7369] Fibonacci example does not include 0; section 4.6

2009-11-20 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- priority: -> critical ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://

[issue7369] Fibonacci example does not include 0; section 4.6

2009-11-20 Thread Mark Dickinson
Mark Dickinson added the comment: That depends on whether you want to start the sequence with F_0 (=0) or F_1 (=1), I guess. Given Python's general preferences for zero-based indexing, I agree that this very serious issue should be fixed. See http://www.research.att.com/~njas/sequences/A

[issue7369] Fibonacci example does not include 0; section 4.6

2009-11-20 Thread prm225
New submission from prm225 : 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