p = str.maketrans(‘123‘,‘abc‘) print(‘33221 ‘.translate(p))
ccbba
maketrans与translate函数
原文:http://www.cnblogs.com/leisurelyRD/p/7552689.html