Create and access a user defined package ArithmeticPackage where the package contains a module named ArithmeticDemo, which inturn contains a method called sumtwo() , subtwo(), multwo() and divtwo() which takes two numbers as parameter and returns the result.
def sumtwo(a,b):
return a+b
def subtwo(a,b):
return a-b
def multwo(a,b):
return a*b
def divtwo(a,b):
return a//b
from ArithmeticPackage import ArithmeticDemo
a=int(input("Enter the a value:"))
b=int(input("Enter the b value:"))
print("The addition of two numbers is",ArithmeticDemo.sumtwo(a,b))
print("The sub of two numbers is",ArithmeticDemo.subtwo(a,b))
print("The multiplication of two numbers is",ArithmeticDemo.multwo(a,b))
print("The division of two numbers is",ArithmeticDemo.divtwo(a,b))
Comments
Post a Comment