Python Challenge攻略之Level 1 Posted on 2013-05-10 In 技术笔记 攻略: K + 2 = MO + 2 = QE + 2 = G也就是译码问题,将所有字母的ASC码加2 代码: #!/usr/bin/env/python#coding:utf8'''Created on May 2, 2013@author: killua@url:http://www.pythonchallenge.com/pc/def/map.html@target: @url:http://www.pythonchallenge.com/pc/def/ocr.html'''#version 1print chr(ord("m") + 2)+chr(ord("a") + 2)+chr(ord("p") + 2)"""PS:字符与ASCII转换char->ascii ord()ascii->char chr()"""#version 2print '*' * 20import strings1 = "g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj."s2 = "map"t = t=string.maketrans( 'abcdefghijklmnopqrstuvwxyz ', 'cdefghijklmnopqrstuvwxyzab ')print string.translate(s1,t)print string.translate(s2, t) 完整代码: Github:https://github.com/zhenlohuang/python-challenge