Created
September 12, 2019 21:10
-
-
Save jadechip/3924c355f40dae058436794e4c9873db to your computer and use it in GitHub Desktop.
Programming challenges: Ceasar Cipher Encryptior
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
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