def least_common_multiple(a, b): """ Function returns lowest common multiple, using Euclid's method for gcd. REQ: a, b >= 0 and whole :param a: {int} :param b: {int} :return: {int} least common multiple of a and b """ return a * b // greatest_common_divisor(a, b)
def test_regular(self): self.assertEqual(greatest_common_divisor(20, 15), 5)
def test_input_one(self): self.assertEqual(greatest_common_divisor(11, 1), 1)
def test_two_primes(self): self.assertEqual(greatest_common_divisor(11, 7), 1)
def test_one_prime(self): self.assertEqual(greatest_common_divisor(11, 4), 1)
def test_same_input(self): self.assertEqual(greatest_common_divisor(15, 15), 15)
def test_input_is_return(self): self.assertEqual(greatest_common_divisor(15, 3), 3)