(no title)
sharth | 10 years ago
from __future__ import division
import itertools
def f(a, b, c, d, e, f, g, h, i):
return a + 13 * b / c + d + 12 * e - f - 11 + g * h / i - 10
for choices in itertools.permutations(range(1, 10), 9):
if abs(f(*choices) - 66) < 0.001:
print choices
There are also some solution that your code will give that are wrong due to your code using integer division.
No comments yet.