Created
May 8, 2020 12:39
-
-
Save chankruze/8ed9764f857edf952f513a0c435007c3 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/python3 | |
from itertools import permutations | |
correct_fill = "285" | |
perm = permutations('123456789', 3) | |
f = open("numbers_permutation.txt", "w") | |
for i, num in enumerate(perm): | |
fill = ''.join(num) | |
count = 0 | |
for j in range(len(fill)): | |
if fill[j] == correct_fill[j]: | |
count += 1 | |
if count > 1: | |
txt = "[" + str(i) + "] " + "79788" + fill + "49\n" | |
f.write(txt) | |
f.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment