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 ...
随机推荐
- Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第十一章:模板测试
原文:Introduction to 3D Game Programming with DirectX 12 学习笔记之 --- 第十一章:模板测试 代码工程地址: https://github.co ...
- 2019-8-31-C#-通过-probing-指定-dll-寻找文件夹
title author date CreateTime categories C# 通过 probing 指定 dll 寻找文件夹 lindexi 2019-08-31 16:55:58 +0800 ...
- DRP 2016-06-30 16:36 314人阅读 评论(21) 收藏
学习drp有一段时间了,其实从很久以前,再提高班的学习就已经不是单纯的学习,学习总是伴随着项目.这就使得我们的学习不可能全天的,大把大把时间的学习只出现在第一和第二年,所以,各自珍惜吧. DRP(Di ...
- NDK(1)简介
AndroidNDK Android NDK 是在SDK前面又加上了“原生”二字,即Native Development Kit,因此又被Google称为“NDK”. Android程序运行在Dalv ...
- LeetCode86 Partition List
题目: Given a linked list and a value x, partition it such that all nodes less than x come before node ...
- Spring security获取当前用户
1.如果在jsp页面中获取可以使用spring security的标签 页面引入标签 <%@ taglib prefix="sec" uri="http://www ...
- 03搭建docker私有仓库
搭建docker私仓,可以使用docker官方提供的registry镜像.该镜像目前有2.0,2.3和2.3.1版本.它只与1.6.0以上版本的docker兼容.搭建私仓的步骤如下: 一:无代理.无认 ...
- es6 默认参数、rest参数、扩展运算符
1.默认值 现在可以在定义函数的时候指定参数的默认值了,而不用像以前那样通过逻辑或操作符来达到目的了. function sayHello(name){ //传统的指定默认参数的方式 var name ...
- filter: grayscale(100%)滤镜属性
效果图: filter滤镜属性
- 20190528-JavaScriptの打怪升级旅行 { 语句 [ 赋值 ,数据 ] }
写在前面的乱七八糟:今天考了试,emmm很基础的题,还是Mrs房的面试题让人绝望啊┓( ´∀` )┏,补了很多知识,很综合的题,坑也很多,总的来说,查漏补缺,其实是啥都缺~ 今天打的小BOSS主要是数 ...