mirror of
https://github.com/kennethreitz/dive-into-python3.git
synced 2026-06-05 23:10:17 +00:00
various typos [thanks G.P.]
This commit is contained in:
+3
-3
@@ -26,7 +26,7 @@ body{counter-reset:h1 6}
|
||||
|
||||
<p class=d>[<a href=examples/fibonacci2.py>download <code>fibonacci2.py</code></a>]
|
||||
<pre><code>class Fib:
|
||||
"""iterator that yields numbers in the Fibanocci sequence"""
|
||||
"""iterator that yields numbers in the Fibonacci sequence"""
|
||||
|
||||
def __init__(self, max):
|
||||
self.max = max
|
||||
@@ -79,7 +79,7 @@ class PapayaWhip: <span>①</span>
|
||||
|
||||
<pre><code>
|
||||
class Fib:
|
||||
<a> """iterator that yields numbers in the Fibanocci sequence""" <span>①</span></a>
|
||||
<a> """iterator that yields numbers in the Fibonacci sequence""" <span>①</span></a>
|
||||
|
||||
<a> def __init__(self, max): <span>②</span></a></code></pre>
|
||||
<ol>
|
||||
@@ -104,7 +104,7 @@ class Fib:
|
||||
<a><samp class=p>>>> </samp><kbd>fib.__class__</kbd> <span>③</span></a>
|
||||
<samp><class 'fibonacci2.Fib'></samp>
|
||||
<a><samp class=p>>>> </samp><kbd>fib.__doc__</kbd> <span>④</span></a>
|
||||
<samp>'iterator that yields numbers in the Fibanocci sequence'</samp></pre>
|
||||
<samp>'iterator that yields numbers in the Fibonacci sequence'</samp></pre>
|
||||
<ol>
|
||||
<li>You are creating an instance of the <code>Fib</code> class (defined in the <code>fibonacci2</code> module) and assigning the newly created instance to the variable <var>fib</var>. You are passing one parameter, <code>100</code>, which will end up as the <var>max</var> argument in <code>Fib</code>’s <code>__init__()</code> method.
|
||||
<li><var>fib</var> is now an instance of the <code>Fib</code> class.
|
||||
|
||||
Reference in New Issue
Block a user