Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
10-liner: had to create my replace function solution in Clear category for Caesar Cipher (encryptor) by Stensen
from string import ascii_lowercase as l_ascii
replace = lambda s, pos, chr: s[:pos] + chr + s[pos+1:]
def to_encrypt(t, d):
for idx, char in enumerate(t):
if char.isalpha():
i = ord(char)-97 + d
if i > 25: i = i-26
if i < 00: i = i+26
t = replace(t, idx, l_ascii[i])
return t
Sept. 27, 2020