Skip to content

Instantly share code, notes, and snippets.

@Proteusiq
Created July 11, 2018 20:32
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 Proteusiq/a894096deb74458016ba4e10b63eb483 to your computer and use it in GitHub Desktop.
Save Proteusiq/a894096deb74458016ba4e10b63eb483 to your computer and use it in GitHub Desktop.
caesarcipher.py
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