The process of using Python 3.x to pythonchallenge-----1

Source: Internet
Author: User

Http://www.pythonchallenge.com/pc/def/274877906944.html
The picture is as follows:


Problem analysis: Look at the picture also do not understand what meaning, so look at the Raiders. The title means: Shift each character two times, for example: K→m
Problem Solving Process:
Import redef CHARSHITF (aa):    p1=re.compile (' [a-x] ')    if P1.match (aa):        return Chr (ORD (AA) +2)    elif AA = = ' Y ':        return ' a '    elif aa = = ' Z ':        return ' B '    else:        return aastraa = "G FMNC wms Bgblr RPYLQJYRC gr ZW fy Lb. 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. "STRBB =" "STRCC =" map "For I in STRCC:    strbb = Strbb +CHARSHITF (i) print (STRBB)
Answer: By interpreting the text content of the page: I hope you didnt translate it by hand. Thats what computers is for. Doing it in by hand are inefficient and that's why the this text was so long. Using String.maketrans () is recommended. Now apply to the URL.
In fact, just interpret the map character, MAP→OCR
Experience: The use of regular expressions, reference to the RE.
The whole procedure is not concise enough, and so on, to adjust it.

Answer procedure for Pythonchallenge-----1 using Python 3.x

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.