先贴代码:
import string str = r"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." table = string.maketrans('abcdefghijklmnopqrstuvwxyz','cdefghijklmnopqrstuvwxyzab') print(str.translate(table))
主要是看懂题目,我没看出来,借鉴别人的。
题目是简单的加密,属于移位加密,字母模右移两位,采用str的translate即可
解密内容为:
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.
应用上述的map,所以下一题的url是:http://www.pythonchallenge.com/pc/def/ocr.html