pythonchallenge Level 1
第1关地址:
打开http://www.pythonchallenge.com/pc/def/274877906944.html后
跳转到http://www.pythonchallenge.com/pc/def/map.html
图片提示信息:K->M,O->Q,E->G
页面有一段看似混乱的文字:
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.
按照图片的字母规律,是把所有字母向后移动2位。
处理下粉色这段文字。
import string text = "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." trantab = str.maketrans(string.ascii_lowercase, string.ascii_lowercase[2:]+string.ascii_lowercase[:2]) print(text.translate(trantab)) # 获得提示 # 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. text = "map" print(text.translate(trantab)) # ocr
得到提示信息: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.
使用相同的处理方式处理url的map,得到ocr,即下一关地址。
本文来自博客园,作者:OTAKU_nicole,转载请注明原文链接:https://www.cnblogs.com/nicole-zhang/p/15557316.html