Skip to content

Instantly share code, notes, and snippets.

@jadechip
Created September 12, 2019 21:10
Show Gist options
  • Save jadechip/3924c355f40dae058436794e4c9873db to your computer and use it in GitHub Desktop.
Save jadechip/3924c355f40dae058436794e4c9873db to your computer and use it in GitHub Desktop.
Programming challenges: Ceasar Cipher Encryptior
def caesarCipherEncryptor(string, key):
alphabet = list("abcdefghijklmnopqrstuvwxyz")
tmp = ""
for char in string:
idx = (alphabet.index(char) + key) % len(alphabet)
tmp += alphabet[idx]
return tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment