python实现字符串之间的映射

类似于凯撒密码一样的加密

# *-* coding=utf-8 *-*

import string

intab = string.lowercase
outtab = 'qwertyuiopasdfghjklzxcvbnm'

old = 'kiqlwtfcqgnsoo'.lower()

new = old.translate(string.maketrans(intab, outtab))
print new

 

posted on 2017-12-08 13:55  gwind  阅读(762)  评论(0编辑  收藏  举报

导航