def euler_009(): for a in range(1, 251): for b in range(a + 1, 501): c = 1000 - a - b if a * a + b * b == c * c: return a * b * c assert(euler_009() == 31875000) print("e009.py: {}".format(euler_009()))