You are viewing a single comment's thread. Return to all comments →
Hi :) Soluntion in Python3 without using ord():
def caesarCipher(s, k): alphabet = "abcdefghijklmnopqrstuvwxyz" decrypt_alphabet = alphabet[k%26:] + alphabet[:k%26] decrypt_dict = dict(zip(alphabet, decrypt_alphabet)) decrypt_s = "" for i_s in s: if i_s.lower() in alphabet: new_i_s = decrypt_dict[i_s.lower()] if i_s.lower() != i_s: new_i_s = new_i_s.upper() decrypt_s += new_i_s else: decrypt_s += i_s return decrypt_s
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 →
Hi :) Soluntion in Python3 without using ord():