Python Challenge--t2

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.