Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
str object has maketrans() and translate() functions, great! solution in Creative category for Caesar Cipher (encryptor) by ArchTauruS
"""str object has maketrans() and translate() functions, great!
"""
def to_encrypt(text, delta):
ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
translate_table = str.maketrans(ascii_lowercase,
ascii_lowercase[delta:] + ascii_lowercase[:delta])
return text.translate(translate_table)
Nov. 12, 2018