Last active
November 6, 2018 06:55
-
-
Save doraneko94/244f21529ae7675626399acd70810028 to your computer and use it in GitHub Desktop.
Descrambler for Caesar cipher.
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
ALPHA = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"] | |
alpha = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"] | |
word = input("Please Enter Words: ") | |
for i in range(len(alpha)): | |
process = "" | |
for w in word: | |
if w in alpha: | |
n = alpha.index(w) + i | |
if n > 25: | |
n -= 26 | |
process += alpha[n] | |
elif w in ALPHA: | |
n = ALPHA.index(w) + i | |
if n > 25: | |
n -= 26 | |
process += ALPHA[n] | |
else: | |
process += w | |
print(process, i) | |
print("") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment