Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
map solution in Clear category for Caesar Cipher (decryptor) by Sim0000
def to_decrypt(cryptotext, delta):
f = lambda c: chr((ord(c) + 7 + delta) % 26 + 97) if c.islower() else c if c == ' ' else ''
return ''.join(map(f, cryptotext))
if __name__ == '__main__':
#These "asserts" using only for self-checking and not necessary for auto-testing
assert to_decrypt("!d! [e] &f*", -3) == "a b c"
assert to_decrypt("x^$# y&*( (z):-)", 3) == "a b c"
assert to_decrypt("iycfbu!@# junj%&", -16) == "simple text"
assert to_decrypt("*$#%swzybdkxd !)(^#%dohd", -10) == "important text"
assert to_decrypt("fgngr **&&frperg^__^", 13) == "state secret"
March 10, 2018
Comments: