哈哈哈,今天老师上课的时候提到了一个有意思的东西,python之禅,
输入import this就可以在python里面看到python之禅,
以下是翻译和原文:
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.所有错误都不应该被直接忽略,除非能够被精确的捕获之后。(其中一个典型的例子就是,不建议用Exception:pass来直接忽略所有异常。)
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.不过&#