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 ...
随机推荐
- 2019-10-26-dotnet-core-发布只有一个-exe-的方法
title author date CreateTime categories dotnet core 发布只有一个 exe 的方法 lindexi 2019-10-26 8:42:7 +0800 2 ...
- MongoDB -- JAVA基本API操作
package com.example.mongodb.mongodb.demo; import com.mongodb.MongoClient; import com.mongodb.client. ...
- C++ 求向量的交集、并集、差集
#include<iostream> #include<stdio.h> #include<list> #include<algorithm> //se ...
- 关于react-router 路径改变页面没有刷新
routert.js 中: <Router> <Switch> <Route exact path="/" component={Login}> ...
- SuperSocket内置的命令行协议
内置的命令行协议(接受自定义,分隔符为“:”,“,”): 命令行协议定义了每个请求必须以回车换行结尾 "\r\n". 由于 SuperSocket 中内置的命令行协议用空格来分割请 ...
- 洛谷P3957 跳房子 题解 二分答案/DP/RMQ
题目链接:https://www.luogu.org/problem/P3957 这道题目我用到了如下算法: 线段树求区间最大值: 二分答案: DP求每一次枚举答案g时是否能够找到 \(\ge k\) ...
- Python--day30--软件开发架构
软件开发架构: C/S架构: B/S架构: B/S架构和C/S架构的关系:
- Python--day27--复习
例1:
- java 集合之HashMap的三种遍历
HashMap 是一个散列表,它存储的内容是键值对(key-value)映射. 这周我们只需记住三种遍历方法 1.通过keySet()获取键,再利用hashmap里面的.get(key)方法通过键获取 ...
- vue样式加scoped后不能覆盖组件的原有样式解决方法
<style scoped> </style> 为了vue页面样式模块化,不对全局造成污染,建议每个页面的style标签加上scoped,表示他的样式只属于当前的页面,父组件的 ...