Exemplo n.º 1
0
	def test_odd(self):
		'''
		Odd number test.
		'''
		r1 = nt.odd(3)
		self.assertEqual(r1, True)
		r3 = nt.odd(0)
		self.assertEqual(r3, False)
Exemplo n.º 2
0
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 ()