请看下面这些话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 p...
而最能直观反映Python设计哲学思想的,应该是Python中的一个小彩蛋。我们只需要在编译器中输入:import this 然后运行,你会发现由Tim Peters所总结的“Python之禅“。全文如下:The Zen of Python, by Tim Peters Beautiful is better than ugly.Explicit is better than implicit.Simple is better than complex.Com...
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! 解释 优美优于丑陋(Beautiful is better than ugly) 程序员经常为实现功能而快速编写代码,导致没有...
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 tobreakthe rules.Although practicality beats purity.Errors should...
在Python的解释器中隐藏一个彩蛋,输入import this就会返回19条Python之禅,具体如下: >>>import this The Zen of Python, by Tim Peters Beautiful is better than ugly. Explicit is better than impl…
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 ...
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. 稀疏胜于密集。
Beautiful is better than ugly. (优美胜于丑陋(Python 以编写优美的代码为目标)) Explicit is better than implicit. (明了胜于晦涩(优美的代码应当是明了的,命名规范,风格相似)) Simple is better than complex. (简洁胜于复杂(优美的代码应当是简洁的,不要有复杂的内部实现)) ...
Beautiful is better than ugly. —— 美丽胜于丑陋 程序是用于解决实际问题的,程序是否美丽,就需要看这个程序的设计是否良好,是否能够高效的解决问题,程序是否足够的简单明了,在经过不断的看代码,写代码的学习过程中,能够有效的提高我们编写代码的能力,随着时间的累积,我们终会写出一手漂亮的代码。
Python之禅指的是Tim Peters 编写的关于python编程准则。 2、操作步骤 在python的交互界面输入import this,回车,会发现返回了一些代码规范。 3、代码 >>>importthisTheZenofPython, byTimPeters蟒宗之禅语,提姆彼得斯(中文是我加的,参考了几种网上的译文)Beautifulisbetter than ugly.优美胜于丑陋Explicitisbetter tha...