def test_multiply_integers(self): """ Test the multiplication of two integers returns the correct result """ result = mymath.multiply(3, 4) self.assertEqual(result, 12)
def test_strings_a_3(): assert multiply('a',3) == 'aaa'
import sys # modify this path to match your environment sys.path.append('C:\Users\mdriscoll\Documents') import mymath print(mymath.add(4, 5)) print(mymath.division(4, 2)) print(mymath.multiply(10, 5)) print(mymath.squareroot(48))
#!/usr/bin/python import sys sys.path.append('/home/za/dev/github/py101') import mymath print mymath.add(10,5) print mymath.multiply(10,5) print mymath.subtract(10,5) print mymath.division(10,5)
def test_numbers_3_4(): assert multiply(3,4) == 12
from mymath import multiply print("Running test") print(multiply(5, 7)) print("Done")
def test_subtract_integers(self): """ Test that multiplying integers returns the correct result """ result = mymath.multiply(5, 50) self.assertEqual(result, 250)
#Enter two numbers x = int(input("Enter 1st number: ")) y = int(input("Enter 2nd number: ")) print() # Call the add function resAdd = mymath.add(x, y) print("Sum =", resAdd) #Call the subtract function resSub = mymath.subtract(x, y) print("Difference =", resSub) #Call the multiply function resMul = mymath.multiply(x, y) print("Product =", resMul) #Call the divide function resDiv = mymath.divide(x, y) print("Division =", resDiv) print() #Call the isPrime function resPri = mymath.isPrime(x) if resPri == True: print(x, "is Prime") else: print(x, "is not Prime") #Call the factorial function
def test_mult_integers(self): """ Test that the multiplication of two integers returns the correct total """ result = mymath.multiply(2, 3) self.assertEqual(result, 6)
def test_strings_a_3(self): self.assertEqual( multiply('a',3), 'aaa')
def test_numbers_3_4(self): self.assertEqual( multiply(3,4), 12)
def test_multiply_integers(self): result = mymath.multiply(5, 5) self.assertEqual(result, 25)
import sys # modify this path to match your environment sys.path.append('C:\Users\mdriscoll\Documents') import mymath print(mymath.add(4,5)) print(mymath.division(4, 2)) print(mymath.multiply(10, 5)) print(mymath.squareroot(48))
import mymath if __name__ == "__main__": assert mymath.add(1, 2) == 3 assert mymath.subtract(2, 1) == 1 assert mymath.multiply(2, 3) == 6 assert mymath.divide(4, 2) == 2
def add_mult(): num1 = request.args.get('num1') num2 = request.args.get('num2') return str(mymath.multiply(int(num1),int(num2)))