Ejemplo n.º 1
0
 def test_multiply_integers(self):
     """
     Test the multiplication of two integers returns the correct result
     """
     result = mymath.multiply(3, 4)
     self.assertEqual(result, 12)
Ejemplo n.º 2
0
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))
Ejemplo n.º 4
0
Archivo: package.py Proyecto: za/py101
#!/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)
Ejemplo n.º 5
0
def test_numbers_3_4():
    assert multiply(3,4) == 12
Ejemplo n.º 6
0
from mymath import multiply

print("Running test")
print(multiply(5, 7))
print("Done")
Ejemplo n.º 7
0
 def test_subtract_integers(self):
     """
     Test that multiplying integers returns the correct result
     """
     result = mymath.multiply(5, 50)
     self.assertEqual(result, 250)
Ejemplo n.º 8
0
#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
Ejemplo n.º 9
0
 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)
Ejemplo n.º 10
0
 def test_strings_a_3(self):
     self.assertEqual( multiply('a',3), 'aaa')
Ejemplo n.º 11
0
 def test_numbers_3_4(self):
     self.assertEqual( multiply(3,4), 12)
Ejemplo n.º 12
0
 def test_subtract_integers(self):
     """
     Test that multiplying integers returns the correct result
     """
     result = mymath.multiply(5, 50)
     self.assertEqual(result, 250)
Ejemplo n.º 13
0
 def test_multiply_integers(self):
     result = mymath.multiply(5, 5)
     self.assertEqual(result, 25)
Ejemplo n.º 14
0
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))
Ejemplo n.º 15
0
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
Ejemplo n.º 16
0
def add_mult():
        num1 = request.args.get('num1')
        num2 = request.args.get('num2')
        return str(mymath.multiply(int(num1),int(num2)))