Skip to content

Instantly share code, notes, and snippets.

@apoz
Created November 17, 2013 00:28
Show Gist options
  • Save apoz/7507339 to your computer and use it in GitHub Desktop.
Save apoz/7507339 to your computer and use it in GitHub Desktop.
Untitled 3
import itertools
mylist = list(itertools.permutations('123456789'))
for (a,b,c,d,e,f,g,h,i) in mylist:
myresul1=float(a+b)/float(c+d+e)
myresul2=float(f+g)/float(h+i)
if myresul1+myresul2==float(7):
print 'Found it ('+a+b+'/'+c+d+e+')+('+f+g+'/'+h+i+')'
break
@juandebravo
Copy link

OLE!!!

@apoz
Copy link
Author

apoz commented Nov 17, 2013

Y sin levantarme del sofa! jajaja

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment