Try this. For python 2.7.12 we need to define constructor or need to add self to each methods followed by defining an instance of an class called object.
import cv2
class calculator:
# def __init__(self):
def multiply(self, a, b):
x= a*b
print(x)
def subtract(self, a,b):
x = a-b
print(x)
def add(self, a,b):
x = a+b
print(x)
def div(self, a,b):
x = a/b
print(x)
calc = calculator()
calc.multiply(2,3)
calc.add(2,3)
calc.div(10,5)
calc.subtract(2,3)