NameError: name 'addition' is not defined
<p>I am getting <code>NameError: name 'addition' is not defined</code> while running following code</p>

<pre><code>class Arithmetic:
    def __init__(self, a, b):
        self.a = a
        self.b = b

    def addition(self):
        c = a + b
        print"%d" %c

    def subtraction(self):
        c=a-b
        print "%d" % c

add = addition(5, 4)
add.addition()
</code></pre>

<p>You first have to create object of class and then you can access class function.
Try this:</p>

<pre><code>a = Arithmatic()
a.addition(5,4)
</code></pre>

python