Skip to content

Instantly share code, notes, and snippets.

@doraneko94
Last active November 6, 2018 06:55
Show Gist options
  • Save doraneko94/244f21529ae7675626399acd70810028 to your computer and use it in GitHub Desktop.
Save doraneko94/244f21529ae7675626399acd70810028 to your computer and use it in GitHub Desktop.
Descrambler for Caesar cipher.
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