在Python解释器中输入 import this 命令可以输出 'The Zen of Python (Python 之禅)' 的内容。这些是Python的设计哲学原则,提供了一些关于代码编写和风格的建议。 因此,答案是D 首先,这道题目要求在Python解释器中输入命令来输出特定内容。 然后,需要了解如何在Python中输出文本内容。 最后,需要知道“Python之禅”...
很好解释的,可能是好方法(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.) Python致力于简化程序员的工作,而不是适应计算机以使程序运行更快。程序不仅需要编写它的程序员可以理解,而且还需要其他维护代码的程序员可以理解。这...
Python的编译器以函数库的形式内置了一个有趣的文件,被称为“Python之禅”(The Zen of Python)。在Python的解释器中输入以下语句:>>> i
打开python命令行输入import this 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 ...
,by Tim Peters有两种流行的翻译:Python之禅与蛇宗三字经。整理于此:蛇宗三字经(The Zen of Python...
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. 扁平式比嵌套式更...
Python 格言(The Zen of Python) Python 的设计哲学是“优雅”、“明确”、“简单”。因此,Perl 语言中“总是有多种方法来做同一件事”的理念在 Python 开发者中通常是难以忍受的。Python 开发者的哲学是“用一种方法,最好是只有一种方法来做一件事”。在设计 Python 语言时,如果面临多种选择,Python 开发...
在python中import this就会展示出The Zen of Python如下: 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. ...
在python的IDLE中,输入 import this 1. 便会出现The Zen of Python(Python之禅),打开安装路径中this.py文件,其代码如下: s = """Gur Mra bs Clguba, ol Gvz Crgref Ornhgvshy vf orggre guna htyl. Rkcyvpvg vf orggre guna vzcyvpvg.
Long time Pythoneer Tim Peters succinctly channels the BDFL's guiding principles for Python's design into 20 aphorisms, only 19 of which have been written down.doi:10.1007/978-1-4302-2758-8_14Tim PetersApressThe Zen of Python. Tim Peters. http://www. python.org/dev/peps/pep-0020/9 ....