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>Check out this piece of code:</p>

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

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

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

obj = Arithmetic()
obj.init(5, 4)
obj.addition()
obj.subtraction()
</code></pre>

python