The Zen of Python —— Python 之禅
- Beautiful is better than ugly. # 优美好于丑陋(Python以编写优美的代码为目标)
- 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. # 虽然那种方法一开始可能并不明显,除非你是 Dutch(Python 之父)
- 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! # 命名空间是个绝妙的主意,让我们做更多这样的事
注:在 Python 的交互式解释器中输入 import this 就可以查阅到上述文档。
The Zen of Python —— Python 之禅的更多相关文章
- python --- Python中的callable 函数
python --- Python中的callable 函数 转自: http://archive.cnblogs.com/a/1798319/ Python中的callable 函数 callabl ...
- Micro Python - Python for microcontrollers
Micro Python - Python for microcontrollers MicroPython
- 从Scratch到Python——python turtle 一种比pygame更加简洁的实现
从Scratch到Python--python turtle 一种比pygame更加简洁的实现 现在很多学校都开设了Scratch课程,学生可以利用Scratch创作丰富的作品,然而Scratch之后 ...
- 从Scratch到Python——Python生成二维码
# Python利用pyqrcode模块生成二维码 import pyqrcode import sys number = pyqrcode.create('从Scratch到Python--Pyth ...
- [Python]Python 使用 for 循环的小例子
[Python]Python 使用 for 循环的小例子: In [7]: for i in range(5): ...: print "xxxx" ...: print &quo ...
- [python]python 遍历一个list 的小例子:
[python]python 遍历一个list 的小例子: mlist=["aaa","bbb","ccc"]for ss in enume ...
- [Python]Python日期格式和字符串格式相互转换
由字符串格式转化为日期格式的函数为: datetime.datetime.strptime() 由日期格式转化为字符串格式的函数为: datetime.datetime.strftime() # en ...
- [python]Python 字典(Dictionary) update()方法
update() 函数把字典dict2的键/值对更新到dict里.如果后面的键有重复的会覆盖前面的语法dict.update(dict2) dict = {'Name': 'Zara', 'Age': ...
- python编程之禅
在python界面输入 import this >>> import this The Zen of Python, by Tim Peters Beautiful is bette ...
随机推荐
- UVA_494:Kindergarten Counting Game
Language: C++ 4.8.2 #include<stdio.h> #include<ctype.h> int main(void) { int ch; int wor ...
- 25-1 request模块介绍
requests模块 - 基于如下5点展开requests模块的学习 什么是requests模块 requests模块是python中原生的基于网络请求的模块,其主要作用是用来模拟浏览器发起请求.功能 ...
- C++类继承中的虚方法
#include <bits/stdc++.h> using namespace std; class A { public: void Show() { cout << &q ...
- SDUT-1479_数据结构实验之栈与队列九:行编辑器
数据结构实验之栈与队列九:行编辑器 Time Limit: 1000 ms Memory Limit: 65536 KiB Problem Description 一个简单的行编辑程序的功能是:接受用 ...
- Java练习 SDUT-2272_Time
Time Time Limit: 1000 ms Memory Limit: 65536 KiB Problem Description Digital clock use 4 digits to e ...
- DRDS 数据恢复重磅发布,全方位保障您的数据安全
背景介绍 数据库存储着企业的核心数据,在企业中占据非常重要的位置,一旦出现SQL注入,数据误删的情况,影响的不仅仅是业务,还会泄露用户的个人信息.因此,数据库的数据安全问题十分重要. 当数据库迁移到云 ...
- 《C语言深度解剖》学习笔记之符号
第2章 符号 1.注释符号 编译器会将注释剔除,用空格代替原来的注释 y=x /* p; 编译器提示出错的原因:实际上,编译器会把“/*”当作一段注释的开始,直到出现“*/”为止. [规则 2-1]注 ...
- oracle函数 RTRIM(c1,[,c2])
[功能]删除右边出现的字符串 [参数]C1 字符串 c2 追加字符串,默认为空格 [返回]字符型 [示例] SQL> select RTRIM('gao qian jingXXXX','X') ...
- hdu 3938 Portal (prim+离线)
Problem - 3938 题意是要求出给定权值下,满足要求的点对的数目.所谓的要求是,给出两点,之间会有很多路径,这个点对的最小距离是众多路径中,最短的一条路径的长度,路径长度是路径上最长边的长度 ...
- 2018-9-28-WPF-自定义-TextBoxView-的-Margin-大小
title author date CreateTime categories WPF 自定义 TextBoxView 的 Margin 大小 lindexi 2018-09-28 17:16:17 ...