Skip to content

Commit 71a7856

Browse files
committed
Added The Zen of Python
1 parent 24bb8a1 commit 71a7856

File tree

5 files changed

+109
-24
lines changed

5 files changed

+109
-24
lines changed

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ All contributions are welcome:
2020

2121
## Python Cheatsheet
2222

23+
- [The Zen of Python](#the-zen-of-python)
2324
- [Python Basics](#python-basics)
2425
- [Math Operators](#math-operators)
2526
- [Data Types](#data-types)
@@ -204,6 +205,39 @@ All contributions are welcome:
204205
- [virtualenv](#virtualenv)
205206
- [pipenv](#pipenv)
206207

208+
## The Zen of Python
209+
210+
From the [PEP 20 -- The Zen of Python](https://www.python.org/dev/peps/pep-0020/):
211+
212+
> 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.
213+
214+
```python
215+
>>> import this
216+
The Zen of Python, by Tim Peters
217+
218+
Beautiful is better than ugly.
219+
Explicit is better than implicit.
220+
Simple is better than complex.
221+
Complex is better than complicated.
222+
Flat is better than nested.
223+
Sparse is better than dense.
224+
Readability counts.
225+
Special cases aren't special enough to break the rules.
226+
Although practicality beats purity.
227+
Errors should never pass silently.
228+
Unless explicitly silenced.
229+
In the face of ambiguity, refuse the temptation to guess.
230+
There should be one-- and preferably only one --obvious way to do it.
231+
Although that way may not be obvious at first unless you're Dutch.
232+
Now is better than never.
233+
Although never is often better than *right* now.
234+
If the implementation is hard to explain, it's a bad idea.
235+
If the implementation is easy to explain, it may be a good idea.
236+
Namespaces are one honking great idea -- let's do more of those!
237+
```
238+
239+
[*Return to the Top*](#python-cheatsheet)
240+
207241
## Python Basics
208242

209243
### Math Operators

blog_files/index.md

Lines changed: 0 additions & 24 deletions
This file was deleted.

blog_files/pysheet.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
1+
## The Zen of Python
2+
3+
From the [PEP 20 -- The Zen of Python](https://www.python.org/dev/peps/pep-0020/):
4+
5+
> 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.
6+
7+
```python
8+
>>> import this
9+
The Zen of Python, by Tim Peters
10+
11+
Beautiful is better than ugly.
12+
Explicit is better than implicit.
13+
Simple is better than complex.
14+
Complex is better than complicated.
15+
Flat is better than nested.
16+
Sparse is better than dense.
17+
Readability counts.
18+
Special cases aren't special enough to break the rules.
19+
Although practicality beats purity.
20+
Errors should never pass silently.
21+
Unless explicitly silenced.
22+
In the face of ambiguity, refuse the temptation to guess.
23+
There should be one-- and preferably only one --obvious way to do it.
24+
Although that way may not be obvious at first unless you're Dutch.
25+
Now is better than never.
26+
Although never is often better than *right* now.
27+
If the implementation is hard to explain, it's a bad idea.
28+
If the implementation is easy to explain, it may be a good idea.
29+
Namespaces are one honking great idea -- let's do more of those!
30+
```
31+
132
## Python Basics
233

334
### Math Operators

python_cheat_sheet.ipynb

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"\n",
2727
"## Python Cheatsheet\n",
2828
"\n",
29+
"- [The Zen of Python](#the-zen-of-python)\n",
2930
"- [Python Basics](#python-basics)\n",
3031
" - [Math Operators](#math-operators)\n",
3132
" - [Data Types](#data-types)\n",
@@ -210,6 +211,49 @@
210211
" - [virtualenv](#virtualenv)\n",
211212
" - [pipenv](#pipenv)\n",
212213
"\n",
214+
"## The Zen of Python\n",
215+
"\n",
216+
"From the [PEP 20 -- The Zen of Python](https://www.python.org/dev/peps/pep-0020/):\n",
217+
"\n",
218+
"> 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."
219+
]
220+
},
221+
{
222+
"cell_type": "code",
223+
"execution_count": null,
224+
"metadata": {},
225+
"outputs": [],
226+
"source": [
227+
">>> import this\n",
228+
"The Zen of Python, by Tim Peters\n",
229+
"\n",
230+
"Beautiful is better than ugly.\n",
231+
"Explicit is better than implicit.\n",
232+
"Simple is better than complex.\n",
233+
"Complex is better than complicated.\n",
234+
"Flat is better than nested.\n",
235+
"Sparse is better than dense.\n",
236+
"Readability counts.\n",
237+
"Special cases aren't special enough to break the rules.\n",
238+
"Although practicality beats purity.\n",
239+
"Errors should never pass silently.\n",
240+
"Unless explicitly silenced.\n",
241+
"In the face of ambiguity, refuse the temptation to guess.\n",
242+
"There should be one-- and preferably only one --obvious way to do it.\n",
243+
"Although that way may not be obvious at first unless you're Dutch.\n",
244+
"Now is better than never.\n",
245+
"Although never is often better than *right* now.\n",
246+
"If the implementation is hard to explain, it's a bad idea.\n",
247+
"If the implementation is easy to explain, it may be a good idea.\n",
248+
"Namespaces are one honking great idea -- let's do more of those!"
249+
]
250+
},
251+
{
252+
"cell_type": "markdown",
253+
"metadata": {},
254+
"source": [
255+
"[*Return to the Top*](#python-cheatsheet)\n",
256+
"\n",
213257
"## Python Basics\n",
214258
"\n",
215259
"### Math Operators\n",

python_cheat_sheet.pdf

2.77 KB
Binary file not shown.

0 commit comments

Comments
 (0)