You are viewing a single comment's thread. Return to all comments →
def caesarCipher(s, k): alphabet = 'abcdefghijklmnopqrstuvwxyz' result = '' for char in s: if char.lower() in alphabet: idx = alphabet.index(char.lower()) + k c = alphabet[idx % len(alphabet)] if char.isupper(): result += c.upper() else: result += c else: result += char return result
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 →