示例#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)
示例#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))
示例#4
0
文件: package.py 项目: 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)
示例#5
0
def test_numbers_3_4():
    assert multiply(3,4) == 12
示例#6
0
from mymath import multiply

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