Remember before the school forum to see the great God recommended a Python game Python challenge, so did a few questions, but also very interesting.
This is the second question, first put the link: http://www.pythonchallenge.com/pc/def/map.html
The topics are as follows:
There are also two paragraphs of text hints:
Everybody thinks twice before solving this.
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.
The topic is very simple, that is, according to the order of the English alphabet, each letter is replaced by the corresponding 2-digit letter, after the passage of this translation came to this:
I hope you didnt translate it by hand. Thats what computers is for. Doing it in by hand are inefficient and thats why the this text was so long. Using String.maketrans () is recommended. Now apply to the URL.
Python Challenge's rule is to find the next topic URL, the link is
Http://www.pythonchallenge.com/pc/def/map.html,
The part you want to replace is ' map ' (the rest is the same), so the next question for you according to the corresponding rules is
Http://www.pythonchallenge.com/pc/def/ocr.html.
The reason to record is to touch a new function:Maketrans ()
Use the following:
from Import Maketrans () ' Koe ' ' MQG '>>> res = Maketrans (INP, out)' pythonchallenge.com/pc/def/map.html' Print str.translate (res)
Output Result:
Pythqnchallgngg.cqm/pc/dgf/map.html
Python Challenge--t2