Skip to content

Instantly share code, notes, and snippets.

@kevinwallace
Created January 6, 2014 22:38
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 kevinwallace/8291116 to your computer and use it in GitHub Desktop.
Save kevinwallace/8291116 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
import sys
import string
text = sys.stdin.read().strip()
alpha = "abcdefghijklmnopqrstuvwxyz"
for i in range(26):
shifted = alpha[i:] + alpha[:i]
frm = alpha + alpha.upper()
to = shifted + shifted.upper()
trans = string.maketrans(frm, to)
print i, string.translate(text, trans)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment