Created
July 11, 2018 20:32
-
-
Save Proteusiq/a894096deb74458016ba4e10b63eb483 to your computer and use it in GitHub Desktop.
caesarcipher.py
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 | |
letters = string.ascii_lowercase | |
def pass_creator(string='',rotation=0): | |
''' | |
Takes in the string and rotate words | |
n steps +n, to get back to original | |
use -n | |
''' | |
items = deque(letters) | |
items.rotate(rotation) | |
rletters = ''.join(items) | |
table = str.maketrans(letters,rletters) | |
return string.translate(table) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment