You are viewing a single comment's thread. Return to all comments →
Python 3
def caesarCipher(s, k): abc = "abcdefghijklmnopqrstuvwxyz" k = k%26 rot = abc[k:] + abc[:k] res = "" for el in s: upp = el.isupper() ind = abc.find(el.lower()) if ind != -1: if upp: res += rot[ind].upper() else: res += rot[ind] else: res += el return res
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