Declare python class, and create class instances. (Core Python Programming)
<p>I'm learning python out of "core python programming 2nd edition"</p>

<p>Im stuck at the part "How to Create Class instances". Page 84.</p>

<p>The example is as follows:</p>

<p>classes.py:</p>

<pre><code>class FooClass(object):

    """my very first class: FooClass"""

    version = 0.1 # class (data) attribute



def __init__(self, nm='John Doe'):

    """constructor"""

    self.name = nm # class instance (data) attribute

    print'Created a class instance for', nm



def showname(self):

    """display instance attribute and class name"""

    print 'Your name is', self.name

    print 'My name is', self.__class__.__name__



def showver(self):

    """display class(static) attribute"""

    print self.version # references FooClass.version



def addMe2Me(self, x): # does not use 'self'

    """apply + operation to argument"""

    return x + x
</code></pre>

<p>Then i have to create Class Instances:</p>

<p>in my interpreter i do the follow:</p>

<pre><code>Import classes *
fool = FooClass()
</code></pre>

<p>But nothing happends. It should print the <strong>init</strong>.</p>

<p>also when i use</p>

<p><code>fool.showname()</code> and <code>fool.showver</code> it doesn't print any. It says</p>

<blockquote>
  <p>FooClass' object has no attribute 'showver</p>
</blockquote>

<p>i really want to know what going on here, before i proceed.
Hopefully someone can help me out!</p>

<p>Thanks in advance! :)</p>
