[PythonChallenge]第1关

来源:互联网 发布:marksimos软件 编辑:程序博客网 时间:2024/04/29 02:42

http://www.pythonchallenge.com/pc/def/map.html


观察图片K->M O->QE->G

发现每个字母+2

于是对于给定的文本, 将每个字母+2

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.

存为pc1_input.txt文件

用Python处理代码如下

#read the filefile_obj = open("pc1_input.txt", "r")try:text = file_obj.read()finally:file_obj.close()#transform the textresult = "".join([chr((ord(l)-95)%26+97) if ord(l) >= ord('a') and ord(l) <= ord('z') else l for l in text])#write the filefile_obj = open("pc1_output.txt", "w")try:file_obj.write(result)finally:file_obj.close()

得到如果为

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.

将地址改为ocr即可


原创粉丝点击