输入如下代码后,会出现有趣的结果!

import this

结果如下:

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!

译文如下:

以编写优美代码为目标,不多解释

优美代码应该清晰明了,规范统一

优美代码应该逻辑简洁,避免复杂逻辑

如果必须采用复杂逻辑,接口关系也要清晰

优美代码应该是扁平的,避免太多层次嵌套

优美代码间隔要适当,每行代码解决适度问题

优美代码必须是可读且易读的

上述规则是至高无上的

捕获异常,不让程序留有因错误退出的可能

不要试图给出多种方案,找到一种实现它,几乎所有人都没有Guido那么牛

编程之前要有思考

能说清楚的往往才是对的

适合复杂程序编程