def test_coprimep(self): ''' Test coprime function. ''' res = nt.coprimep(2,5) self.assertEqual(res, True) res = nt.coprimep(2,10) self.assertEqual(res, False)
def pythagonum(m, n): ''' Calculate pythagorean number. ''' if nt.coprimep(m, n) and nt.odd(m-n): return (m**2-n**2, 2*m*n, m**2+n**2) else: return ()