What are the interesting challenge topics of Python?
This article mainly talks about "what are the interesting challenges of Python". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn "what are the interesting challenge topics of Python"?
The first question
This question can only be regarded as a warm-up question, and there is a prompt below, "Hint: try to change the URL address."
In fact, the answer is to use the result of 2 to the power of 38 as the entrance link to the next question, because 2 percent 38 equals 274877906944, so the link address of the second question is the link to this question.
Replace http://www.pythonchallenge.com/pc/def/0.html with: question 2 of http://www.pythonchallenge.com/pc/def/274877906944.html
When you open the link, you will be redirected to a new page, which appears as follows:
The information provided in the picture should be similar to Caesar encryption, K-> MMagol O- > QMagol E-> G, which means that each letter has moved 2 bits to the right, you can guess a-> c-> e, … X-> z, y-> a minute z-> b, and there is also a string of encrypted prompts. In order to get the correct answer, we have to decrypt this string.
The decryption algorithm can be obtained by implementing it in code first:
Def decrypt (c):
Return chr (ord (c) + 2)-ord ('a')) 26 + ord ('a'))
Decrypt the encrypted string to get:
> > s = ""
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.
"
> result = ""
> for c in raw:
... If c > ='a 'and c