You are viewing a single comment's thread. Return to all comments →
Python 3
def caesarCipher(s, k): alphabet = "abcdefghijklmnopqrstuvwxyz" new_string = "" for i in s: if i.isalpha(): letter = alphabet[(k + alphabet.index(i.lower()))%26] if i.isupper(): new_string += letter.upper() else: new_string += letter else: new_string += i return new_string
Seems like cookies are disabled on this browser, please enable them to open this website
Caesar Cipher
You are viewing a single comment's thread. Return to all comments →
Python 3