問(wèn)題鏈接
問(wèn)題鏈接如下:
http://www.pythonchallenge.com/pc/def/map.html
答案鏈接
答案鏈接如下:
http://www.pythonchallenge.com/pc/def/ocr.html
解題思路
將頁(yè)面給定的字符串根據(jù)給定規(guī)則進(jìn)行替換即可怒详,規(guī)則如下:
K -> M
O -> Q
E -> G
轉(zhuǎn)換代碼如下:
msg = "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."
for c in msg:
if c <= 'z' and c >= 'a':
if chr(ord(c)+2) > 'z':
c = chr(ord(c)-24)
else:
c = chr(ord(c)+2)
print(c, end='')
print('')
輸出信息為:
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.
根據(jù)提示蛤高,將url中的map
進(jìn)行轉(zhuǎn)換废赞,得到map
复颈,則為最終的答案鏈接傅瞻。