def shift_encode(plaintext, n):
    "Encode text with a shift cipher that moves each letter up by n letters."
    from string import maketrans
    code = alphabet[n:] + alphabet[:n]
    trans = maketrans(alphabet + alphabet.upper(), code + code.upper())
    return plaintext.translate(trans)
Encode text with a shift cipher that moves each letter up by n letters.
recipes/Python/442000_Decoding_Shift_or_Rotatior_Caesar_Cipher_or/recipe-442000.py