Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- key = open('key.txt', 'r').read()
- mat = open('init.txt', 'r').read().replace('\n', '')
- choices = list({c for c in key} - {c for c in mat})
- newmat = ''
- for c in mat:
- if not c in newmat:
- newmat += c
- else:
- repl = choices[0]
- choices.remove(repl)
- newmat += repl
- open('output.txt', 'w').write('\n'.join([newmat[i:i + 5] for i in range(0, 25, 5)]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement