Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
abc solution in Clear category for Caesar Cipher (encryptor) by zwerkoff
def to_encrypt(text, delta):
abc = 'abcdefghijklmnopqrstuvwxyz'
c = ''
for letter in text:
if letter in abc:
i = (abc.index(letter) + delta)
c += abc[i % 26]
else:
c += letter
return c
#better:
#from string import ascii_lowercase as ascii
#
# def to_encrypt(text, delta):
# return "".join([ascii[(ascii.index(i) + delta) % len(ascii)] if i in ascii else i for i in text])
Aug. 5, 2020