This program finds magic squares 3x3 by brute force and automatically prints when you find one.
code:
import random
vetor = [1, 2, 3, 4, 5, 6, 7, 8, 9]
def magicsquare():
return vetor[0]+vetor[1]+vetor[2]==\
vetor[3]+vetor[...
asked by
28.12.2017 / 23:38