Last active
October 18, 2020 00:30
-
-
Save JasonBristol/19902c268e8d42b96b0db879a2ca3fe0 to your computer and use it in GitHub Desktop.
Tiny python 3.x script to solve atbash ciphers
This file contains hidden or 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
s = input("Please enter the cipher text: ") | |
chars = "abcdefghijklmnopqrstuvwxyz" | |
exclude = " '\":;.,?!" | |
result = [] | |
for c in s: | |
if c in exclude: | |
result.append(c) | |
else: | |
idx = 0 - (chars.index(c) + 1) | |
result.append(chars[idx]) | |
print("".join(result)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment