Python Puzzle Level 1

Source: Internet
Author: User
Tags ord rfc

The first level can be resolved after the first pass.

Looks like a mysterious look. But that is to turn the letter K into M, o into Q, E to G. The ASCII value of the letter corresponding to +2 is OK.

1 #-*-coding:utf-8-*-2 #code versions are Python 3.5.13 #Level 14str ="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."5 6 defdecode (i):7     """The value of I is treated by the function method8 note the range of lowercase letters in ASCII9 use function ord () Chr ()Ten function content can be optimized, I am too lazy to move.  One     """ A     ifOrd (i) >=ord ("a") andOrd (i) +2<=ord ("Z"):   -         returnChr (Ord (i) +2)   -     elifi=="y" ori=="Z":   the         returnChr (Ord (i) +1-ord ("Z") +ord ("a"))   -     Else :   -         returnI -  +  forIinchStr: -     Print(Decode (i), end="")

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.

That's what happened after the decryption.

It seems that the author does not want us to use this method ... The amount ... My heart is almost broken ...

However, it is good to come again

1 #-*-Coding:utf-8-*-2 #code versions are Python 3.5.13 #Level 14 Importstring5 6STR1 ="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."7STR2 ="Map"8 9Table = Str.maketrans (string.ascii_lowercase,string.ascii_lowercase[2:]+string.ascii_lowercase[:2])Ten #I believe this slice is understandable. One Print(str1.translate (table)) A Print(Str2.translate (table))

See this link for a description of the function

http://blog.csdn.net/wirelessqa/article/details/23793127

So we can get the next URL (which is to transform the map into OCR according to the rules)

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

Good Night ~

Python Puzzle Level 1

Related Article

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.