[Solution] Pythonchallenge Level 1

Source: Internet
Author: User
Tags rfc

Http://www.pythonchallenge.com/pc/def/map.html

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.

Abcdefghijklmnopqrstuvwxyz

K+2=m

O+2=q

>>>import string

>>>text= "" "G FMNC wms Bgblr RPYLQJYRC gr ZW fylb. Rfyrq ufyr amknsrcpq ypc dmp. Bmgle GR GL ZW fylb GQ GLCDDG AGCLR ylb Rfyr ' q UFW rfgq rcvr GQ QM Jmle. Sqgle QRPGLE.KYICRPYLQ () GQ PCAMKKCLBCB. LMU ynnjw ml RFC spj. """

-1: >>>rule=string.maketrans (string.ascii_lowercase,string.ascii_lowercase[2:]+string.ascii_lowercase[ : 2])

-2: >>>rule=string.maketrans (' abcdefghijklmnopqrstuvwxyz ', ' Cdefghijklmnopqrstuvwxyzab ')

>>>string.translate (Text,rule)

"I hope didnt translate it by hand. Thats what computers is for. Doing it I
n by hand was inefficient and that's why the this text was so long. Using String.maket
Rans () is recommended. Now apply to the URL. "

>>>a= ' map ' #apply on the value of the Url,url is map

>>>string.translate (A,rule)

Ocr

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

[Solution] Pythonchallenge Level 1

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.