[issue31757] Tutorial: Fibonacci numbers start with 1, 1

2017-10-11 Thread Heinrich Schnermann

New submission from Heinrich Schnermann :

In https://docs.python.org/3/tutorial/controlflow.html#defining-functions both 
examples produce fibonacci numbers starting with 0. They should start with 1, 
as in the example in 
https://docs.python.org/3/tutorial/introduction.html#first-steps-towards-programming

The first example should change the lines
while a < n:
print(a, end=' ')
to
while b < n:
print(b, end=' ')

and the second example should change the lines
while a < n:
result.append(a)# see below
to
while b < n:
result.append(b)# see below

--
assignee: docs@python
components: Documentation
messages: 304144
nosy: docs@python, skyhein
priority: normal
severity: normal
status: open
title: Tutorial: Fibonacci numbers start with 1, 1
type: behavior
versions: Python 3.6

___
Python tracker 
<https://bugs.python.org/issue31757>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31757] Tutorial: Fibonacci numbers start with 1, 1

2017-10-11 Thread Heinrich Schnermann

Heinrich Schnermann  added the comment:

I would not insist of starting with 1 instead of 0 (I follow your arguments 
here), but perhaps it would be nice if it would behave the same way in both 
chapters. The first fibonacci number examples in 
https://docs.python.org/3/tutorial/introduction.html#first-steps-towards-programming
 start with 1.

There are three examples here, in the first,

while b < 10:
print(b)

should change to

while a < 10:
print(a)

The output of this first example would have an additional 0:
0
1
1
...

And in the third example

while b < 1000:
print(b, end=',')

should change to

while a < 1000:
print(a, end=',')

where the output of this third example would change from

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

to

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

--

___
Python tracker 
<https://bugs.python.org/issue31757>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com