Esempio n. 1
0
def test_rand_sum():
    for i in range(1000):
        a = randint(-100,100)
        b = randint(-100,100)
        assert(get_sum(a,b) == a + b)
Esempio n. 2
0
def test_rand_sum():
    for i in range(1000):
        a = uniform(-100,100)
        b = uniform(-100,100)
        assert(get_sum(a,b) == a + b)
Esempio n. 3
0
def test_sum():
    for i in range(1000):
      first = uniform(-1000, 1000)
      second =  uniform(-1000, 1000)
      assert(get_sum(first, second) == (first + first))
Esempio n. 4
0
#         return sum_1

# def main():
#     print("Sum :", Sum.get_sum(1,2,3,4,5))

# class Dog:
#     num_of_dogs = 0

#     def __init__(self, name = "Unknown"):
#         self.name = name
#         Dog.num_of_dogs += 1

#     @staticmethod
#     def get_num_of_dogs():
#         print("There are currently {} dogs".format(Dog.num_of_dogs))

# def main():
#     spot = Dog("Spot")
#     doug = Dog("Doug")
#     spot.get_num_of_dogs()

# main()

#Custom modules

#import sum

from sum import get_sum

print("Sum :", get_sum(1, 2, 3, 4, 5))
Esempio n. 5
0
def test_rand_sum():
    for i in range(1000):
        a = choice(al)
        b = choice(al)
        assert(get_sum(a,b) == a + b)
Esempio n. 6
0
def test_sum():
    assert (get_sum(1, 2) == 3)
Esempio n. 7
0
def test_sum():
    for i in range(1000):
        alphabet = "ABCDEFGHIKLMNOPQRSTVXYZ"
        first = choice(alphabet)
        second =  choice(alphabet)
        assert(get_sum(first, second) == (first + first))