mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +00:00
Fix up some examples in the tutorial so we don't contradict our own
advice on docstrings. This fixes SF bug #495601.
This commit is contained in:
parent
6bc62c4951
commit
23d45f4744
1 changed files with 2 additions and 2 deletions
|
@ -1228,7 +1228,7 @@ arbitrary boundary:
|
|||
|
||||
\begin{verbatim}
|
||||
>>> def fib(n): # write Fibonacci series up to n
|
||||
... "Print a Fibonacci series up to n"
|
||||
... """Print a Fibonacci series up to n."""
|
||||
... a, b = 0, 1
|
||||
... while b < n:
|
||||
... print b,
|
||||
|
@ -1306,7 +1306,7 @@ the Fibonacci series, instead of printing it:
|
|||
|
||||
\begin{verbatim}
|
||||
>>> def fib2(n): # return Fibonacci series up to n
|
||||
... "Return a list containing the Fibonacci series up to n"
|
||||
... """Return a list containing the Fibonacci series up to n."""
|
||||
... result = []
|
||||
... a, b = 0, 1
|
||||
... while b < n:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue