欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

The Python Challenge 解密之旅

程序员文章站 2022-05-14 18:27:37
本文是记录博主运用 Python 来解决 The Python Challenge 站点中每个关卡的难题。 The Python challenge 站点地址:http://www.pythonchallenge.com/ 说明:本文为博主自主原创,允许转载,但是必须标明来源出处及其作者,谢谢! T ......

本文是记录博主运用 Python 来解决 The Python Challenge 站点中每个关卡的难题。

The Python challenge 站点地址:http://www.pythonchallenge.com/

说明:本文为博主自主原创,允许转载,但是必须标明来源出处及其作者,谢谢!

The Python Challenge 介绍

The Python Challenge 解密之旅

Python Challenge is a game in which each level can be solved by a bit of (Python) programming.

The Python Challenge was written by Nadav Samet.

All levels can be solved by straightforward and very short scripts.

Python Challenge welcomes programmers of all languages. You will be able to solve most riddles in any programming language, but some of them will require Python.

Sometimes you'll need extra modules. All can be downloaded for free from the internet.

It is just for fun - nothing waits for you at the end.

Keep the scripts you write - they might become useful. 

原文大概意思如下挑战 Python 是一个每个关卡都可以被一些(Python)编程解决的游戏。挑战 Python 是 Nadav Samet 写的。所有的关卡都可以通过非常明了的、简单的脚本解决。挑战 Python 欢迎运用任何一门编程语言的程序员。你将能够运用任何一门编程语言来解决每个关卡中的难题,他们其中某些人可能需要用到 Python。你有时会需要额外的模块。它们都可以从互联网中免费下载。仅仅是为了好玩,在最后并没有什么在等待你。你一直以来写的脚本可能会成为有用的

The Python Challenge FAQ

What is the Python Challenge?

The Python Challenge is a set of riddles that require a little bit of Python programming to be solved. The solutions are entered by changing the address of the page (URL). You get used to the idea pretty fast after solving the first few levels.

What's the purpose of the Python Challenge?

I've written the challenge in hope that it will provide an entertaining way to explore the Python Programming Language. It is a way to demonstrate the great power of Python's batteries.

Where did you get the idea from? 

I was inspired while I was playing notpron. It just occured to me that the same style of riddles can serve as a way to discover Python.

What is the Python programming language? 

From Python website: "Python is an interpreted, interactive, object-oriented programming language. It is often compared to Tcl, Perl, Scheme or Java. Python combines remarkable power with very clear syntax. It has modules, classes, exceptions, very high level dynamic data types, and dynamic typing."

Where can I get Python? 

Windows users: ActivePython (freeware) or Idle (opensource)
Mac users: MacPython (opensource)
Linux users: Most Linux distributions come with Python installed. Just type python in the shell.

Where can I learn Python? 

Start with this excellent Python Tutorial.

Do I have to use Python to solve the riddles? 

Most of the riddles can be solved with any language. Currently, only riddles 5 and 23 require Python. The hints in all riddles are geared towards Python programmers.

What level of Python knowledge is required for solving the riddles? 

The riddles are designed to be solvable by Python newcomers and yet challenging even for Python experts. If you don't know how to do a certain thing in Python or you are referenced to an unfamiliar module - treat it as an opportunity to learn it. Google is your friend.

And if I get stuck solving a riddle? 

Search for hints in the Python Challenge forums.

你准备好了吗?那就愉快地开始吧

第 00 关

挑战地址:-----> 点我传送 <-----

The Python Challenge 解密之旅

Hint: try to change the URL address.

提示:尝试更改 URL 地址

分析图片上显示的是 2 的 38 次方,所以猜到此用意是用计算 2 的 38 次方的结果去替换该挑战地址的 URL

只要在终端输入如下代码即可:

>>> 2 ** 38
274877906944

用数字 274877906944 去更换 URL 中的 0 即可进入下一关卡。

第 01 关

挑战地址:-----> 点我传送 <-----

The Python Challenge 解密之旅

everybody thinks twice before solving this.

待更新......