python挑战之level 23

连接: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,string

s='va gur snpr bs jung?'.upper()
d=''
for i in s:
    if i in string.ascii_uppercase:
        d += this.d[i]
    else:
        d+=i
print(d.lower())

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


结果为:

The Zen of Python, by Tim Peters

Beautiful 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
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值