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:
Fred Drake 2001-12-20 23:54:56 +00:00
parent 6bc62c4951
commit 23d45f4744
1 changed files with 2 additions and 2 deletions

View File

@ -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: