由图中的映射关系,K->M,O->P,E->G,可以看出它是将字母表中的每个字母顺次往后平移两次。对下方的一串文字进行此操作即可。
import string
hints = '''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.'''
source = string.ascii_lowercase
table = str.maketrans(source, source[2:] + source[:2])
print(hints.translate(table))
#i hope you didnt translate it by hand. thats what computers are for.
#doing it in by hand is inefficient and that's why this text is so long.
#using string.maketrans() is recommended. now apply on the url.
print("map".translate(table)) #ocr
#http://www.pythonchallenge.com/pc/def/ocr.html
在看到提示 “using string.maketrans() is recommended” 之前