Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random as rand
- resolvido = False
- def gera_3_valores():
- return rand.sample(range(0, 9), 3)
- while not resolvido:
- valores = gera_3_valores()
- x = valores[0]
- y = valores[1]
- z = valores[2]
- print("x: {}, y: {}, z: {}".format(x, y, z))
- valor = int(str(x) + str(y) + str(z))
- solucao = (valor * 3)
- if solucao == int(str(z) + str(z) + str(z)):
- resolvido = True
- print("{}{}{} * 3 = {}".format(x, y, z, solucao))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement