You are viewing a single comment's thread. Return to all comments →
def caesarCipher(s, k): ans = '' k = k % 26 for i in s: if i.islower(): ans += chr(((ord(i) - ord('a') + k) % 26) + ord('a')) elif i.isupper(): ans += chr(((ord(i) - ord('A') + k) % 26) + ord('A')) else: ans += i return ans
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 →