version for Python 3.4.3
import codecs def caesar(s): return codecs.encode(s, 'rot_13')
# caesar cipher shifted of 13 characters with maketrans for python 2.7from string import maketransimport string- import codecs
- def caesar(s):
print(s)s=s.translate(maketrans(string.ascii_uppercase, string.ascii_uppercase[13:]+string.ascii_uppercase[:13]))return s- return codecs.encode(s, 'rot_13')
Algorithms
Logic
Mathematics
Numbers