pythonchallenge第二关

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.

上代码:

str1="""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."""

str2="abcdefghijklmnopqrstuvwxyz"
str3="cdefghijklmnopqrstuvwxyzab"

from string import maketrans
print str1.translate(maketrans(str2,str3))

print "map".translate(maketrans(str2,str3))




得出map偏移后的值为OCR



得出下关地址:

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

你可能感兴趣的:(html,python)