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
|
@ -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…
Reference in New Issue