Created
May 20, 2015 17:56
-
-
Save alcides/8e8a219ebaeb7f0fd543 to your computer and use it in GitHub Desktop.
Solução para: http://www.publico.pt/mundo/noticia/ha-um-novo-quebracabecas-de-matematica-vindo-da-asia-1696286
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def check(arr): | |
return arr[0] + 13 * arr[1] / float(arr[2]) + arr[3] + 12 * arr[4] - arr[5] - 11 + arr[6] * arr[7] / float(arr[8]) - 10 == 66 | |
import random | |
arr = range(1,10) | |
while not check(arr): | |
random.shuffle(arr) | |
print arr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment