from mod1 import div import mod2 as s div = div(300, 15) print(int(div)) print(s.pal('151')) print(s.fact(5))
# Module Example import mod1 as md addtion = md.add(10,15) print(addtion) print("---------------------") res = md.sub(20,15) print(res) print("---------------------") mult = md.prod(20,15) print(mult) print("---------------------") div = md.div(300,15) print(int(div)) print("---------------------")
import mod1, mod2 mod2.addData([1, 2, 3, 4, 5, 5, 6, 7]) print(mod1.div(45, 5))
import mod1 as cal res= cal.div(5,4) print(res)
import mod1 i = int( input( 'for addition 1 : for substraction 2 : for multiplication 3 : for division 4 : ' )) n1 = int(input("Enter first number")) n2 = int(input("Enter second number")) if i == 1: mod1.add(n1, n2) print(mod1.add(n1, n2)) elif i == 2: mod1.sub(n1, n2) print(mod1.sub(n1, n2)) elif i == 3: mod1.mul(n1, n2) print(mod1.mul(n1, n2)) elif i == 4: mod1.div(n1, n2) print(mod1.div(n1, n2))