Skip to content

Instantly share code, notes, and snippets.

@zettca
Created December 17, 2017 18:57
Show Gist options
  • Save zettca/65094fe7dcfb323c074562a37a24b1f2 to your computer and use it in GitHub Desktop.
Save zettca/65094fe7dcfb323c074562a37a24b1f2 to your computer and use it in GitHub Desktop.
Python3 ROT n encode
chrs = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
def rot_encode(string, i):
return "".join([chrs[chrs.index(c) + i % len(chrs)] for c in string])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment