def main(): a = int(input("Enter First no.")) b = int(input("Enter Second no.")) r1 = mymodule.add(a, b) r2 = mymodule.sub(a, b) r3 = mymodule.mul(a, b) r4 = mymodule.div(a, b) print("add:-", r1, "sub:-", r2, "Mul:-", r3, "division:-", r4)
def main(): a = int(input("enter 1st no.")) b = int(input("enter 2nd no.")) r1 = bdm.add(a, b) r2 = bdm.sub(a, b) r3 = bdm.mul(a, b) r4 = bdm.div(a, b) print("add:-", r1, "sub:-", r2, "Mul:-", r3, "div:-", r4)
from mymodule import add, sub, multi, div a = int(input("Enter the number of a:")) b = int(input("Enter the number of b:")) x = int(input("Choose the option:")) if x == 1: add(a, b) elif x == 2: sub(a, b) elif x == 3: multi(a, b) elif x == 4: div(a, b)
import mymodule print("hello world") mymodule.greeting("Manish") mymodule.add(2, 3) mymodule.diff(100, 100) mymodule.mult(12, 3) mymodule.div(12, 4) x = mymodule.person1["age"] print(x) mymodule.int(100, 5, 10)
import mymodule a = int(input("정수를 입력하세요. : ")) b = int(input("또 다른 정수를 입력하세요. : ")) print("다음 덧셈의 결과입니다.") print(mymodule.sum(a, b)) print("다음 뺄샘의 결과입니다.") print(mymodule.min(a, b)) print("다음 곱셈의 결과입니다.") print(mymodule.mul(a, b)) print("다음 나눗셈의 결과입니다.") print(mymodule.div(a, b))
''' title: 引入自定义模块 time: 2018.04.09 18:45 author: 杨龙(Alex) ''' # import 模块名 import mymodule print(mymodule.add(5, 2)) print(mymodule.sub(5, 2)) print(mymodule.mul(5, 2)) print(mymodule.div(5, 2)) print(mymodule.FILE_PATH) print(mymodule.PI)
import mymodule print("\"import\" sample") print(mymodule.add(8, 2)) print(mymodule.sub(-5, 2)) print(mymodule.mul(1, 2)) print(mymodule.div(657, 2))
import mymodule import datetime as mx print('1 + 8 =',mymodule.add(1,8)) print('4 - 2 =',mymodule.sub(4,2)) print('6 x 6 =',mymodule.mul(6,6)) print('8 / 2 =',mymodule.div(8,2)) x=mx.datetime.now() print('Year: ',x.strftime('%Y')) print('Month: ',x.strftime('%B')) print('Day: ',x.strftime('%A')) print('Time: ',x.strftime('%X')) print('Date: ',x.strftime('%x')) print('Tomorrow :',mx.datetime.now() + mx.timedelta(days=1)) print('Yesterday :',mx.datetime.now() - mx.timedelta(days=1))