Python strings have a [`translate`][1] method that applies a substitution cipher. There is also a function [`str.maketrans`][2] (`string.maketrans` in Python 2) that helps with building the translation table: >>> from string import ascii_lowercase as alphabet >>> shift = 13 >>> cipher = str.maketrans(alphabet, alphabet[shift:] + alphabet[:shift]) >>> print("caeser salad is tasty".translate(cipher)) pnrfre fnynq vf gnfgl [1]: http://docs.python.org/3/library/stdtypes.html#str.translate [2]: http://docs.python.org/3/library/stdtypes.html#str.maketrans