Created
December 8, 2011 10:30
-
-
Save s3thi/1446664 to your computer and use it in GitHub Desktop.
Caesar Cipher #2
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
import string | |
from collections import deque | |
alphabet = string.ascii_lowercase | |
alphabet_deque = deque(alphabet) | |
alphabet_deque.rotate(-2) | |
rotated_alphabet = ''.join(alphabet_deque) | |
tbl = string.maketrans(alphabet, rotated_alphabet) | |
msg = 'a quick brown fox jumped over the lazy dog' | |
encoded_msg = string.translate(msg, tbl) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment