How do I convert my fun.py into a module so that I can use it in untitled.py?
fun.py
class test:
def __init__(self,num0,num1):
self.num0 = num0
self.num1 = num1
def add(self):
self.num0 + self.num1
def sub(self):
self.num0 - self.num1
def mul(self):
self.num0 * self.num1
def div(self):
self.num0 / self.num1
untitled.py
from a import fun
a = eval(input('enter a:'))
b = eval(input('enter b:'))
test = fun.test(a,b)
print(test.add())