Skip to content

Instantly share code, notes, and snippets.

@chankruze
Created May 8, 2020 12:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chankruze/8ed9764f857edf952f513a0c435007c3 to your computer and use it in GitHub Desktop.
Save chankruze/8ed9764f857edf952f513a0c435007c3 to your computer and use it in GitHub Desktop.
#!/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