Skip to content

Instantly share code, notes, and snippets.

@apoz
Created November 17, 2013 00:12
Show Gist options
  • Save apoz/7507165 to your computer and use it in GitHub Desktop.
Save apoz/7507165 to your computer and use it in GitHub Desktop.
import itertools
mylist = list(itertools.permutations('123456789'))
for (a,b,c,d,e,f,g,h,i) in mylist:
myresul1=(float(a)*10+float(b))/(float(c)*100+float(d)*10+float(e))
myresul2=(float(f)*10+float(g))/(float(h)*10+float(i))
if myresul1+myresul2==float(7):
print 'Found it'+a+b+c+d+e+f+g+h+i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment