from mul import multiply from div import division def addition(a,b): return a+b def subtraction(a,b): return a-b; if __name__ == "__main__": a = 3 b = 5 print(addition(a,b)) print(subtraction(a,b)) print(multiply(a, b)) print(division(a, b)) ''' clone from github Create new branches for Multiplication and Division merge with master push to github '''
b=k; break; else: print "Undefined"; k=substract(a,b); print "The current difference is "+str(k); #MULTIPLY elif c==3: if prev==0: a=input("Enter one number"); b=input("Enter another number"); elif prev==1: a=k; b=input("Enter another number"); k=multiply(a,b); print "The current product is "+str(k); #DIVIDE elif c==4: if prev==0: a=input("Enter numerator"); b=input("Enter denominator"); elif prev==1: while 1: print "Enter your choice\n1.Use answer as numerator\n2.Use answer as denominator"; e=input(); if e==1: a=k; b=input("Enter denominator"); break;
def test_3_mul_4(self): self.assertEqual(multiply(3, 4), 12)
def test_a_mul_3(self): self.assertEqual(multiply('a', 3), 'aaa')
def test_multiplication_with_correct_values(self): self.assertEqual(multiply(5,5),25)
import mul n = int(input("Enter no of rows in 1st matrix")) mat1 = [] for i in range(0, n): lis = list(map(int, input().split())) mat1.append(lis) x = len(mat1[0]) m = int(input("Enter no of rows in 2nd matrix")) mat2 = [] for i in range(0, m): lis = list(map(int, input().split())) mat2.append(lis) y = len(mat2[0]) if (x == m): res = mul.multiply(mat1, mat2) print(res) else: print("NOt possible")