python挑战之level 23

来源:互联网 发布:dnf卡史诗软件 编辑:程序博客网 时间:2024/05/29 18:57

连接:http://www.pythonchallenge.com/pc/hex/bonus.html

登陆密码;(butter,fly)

——————————————————————————————————————————————————————

这是一头牛的图片,看看其他的信息:

标题:what is this module?

注释:

<!-- TODO: do you owe someone an apology? now it is a good time to tell him that you are sorry. Please show good manners although it has nothing to do with this level. --><!-- it can't find it. this is an undocumented module. -->

<!-- 'va gur snpr bs jung?' -->——————————————————————————————————————————————————

这个是什么意思呢?让我们道歉?并且这是一个无证模块?后面的乱码是什么啊?

百度一下;

‘this'竟然是一个模块,就是undocmented module.,这也是个脑筋急转弯!是吧?


在this模块中有一个字典,存放着字符的转换,所以我们使用this.d来解密乱码

<pre name="code" class="python">import this,strings='va gur snpr bs jung?'.upper()d=''for i in s:    if i in string.ascii_uppercase:        d += this.d[i]    else:        d+=iprint(d.lower())

————————————————————————————————————————————————————


结果为:

The Zen of Python, by Tim PetersBeautiful is better than ugly.Explicit is better than implicit.Simple is better than complex.Complex is better than complicated.Flat is better than nested.Sparse is better than dense.Readability counts.Special cases aren't special enough to break the rules.Although practicality beats purity.Errors should never pass silently.Unless explicitly silenced.In the face of ambiguity, refuse the temptation to guess.There should be one-- and preferably only one --obvious way to do it.Although that way may not be obvious at first unless you're Dutch.Now is better than never.Although never is often better than *right* now.If the implementation is hard to explain, it's a bad idea.If the implementation is easy to explain, it may be a good idea.Namespaces are one honking great idea -- let's do more of those!in the face of what ?
————————————————————————————————————————————————————————————

最后一行是得到的字符串,前面的是import  this 模块带来的,这是一首诗,

in the face of what ?
在诗中低12行,
In the face of ambiguity, refuse the temptation to guess.
答案为:<pre name="code" class="python">ambiguity

下一关:http://www.pythonchallenge.com/pc/hex/ambiguity.html

0 0
原创粉丝点击