Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Easy to read solution in Clear category for Caesar Cipher (encryptor) by Wartem
def encrypt_word(word, delta):
res = ""
for c in word:
c = ord(c) + delta
if c > ord("z"):
c -= 26
elif c < ord("a"):
c += 26
res += chr(c)
return res
def to_encrypt(cryptotext, delta):
res = []
for word in cryptotext.split():
res.append(encrypt_word(word, delta))
return ' '.join(res)
Sept. 14, 2022