Skip to content

Commit fa34e46

Browse files
committed
updates
1 parent 53889e5 commit fa34e46

1 file changed

Lines changed: 49 additions & 1 deletion

File tree

readme.md

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ At first glance, Python and Ruby appear to be very similar languages. Both are h
44

55
Well, with a dynamically typed language you can do this:
66

7-
```python
7+
```sh
88
>>> variable = 1
99
>>> type(variable)
1010
<type 'int'>
@@ -20,4 +20,52 @@ Essentially, I can change the datatype (from an integer to a string to a list, i
2020

2121
Both support multiple programming paradigms as well - e.g, procedural, functional, object oriented, and so forth.
2222

23+
However, there are a number of differences ..
2324

25+
### The Python Way
26+
27+
Open your terminal and open the Python shell then type `import this`:
28+
29+
```sh
30+
>>> import this
31+
The Zen of Python, by Tim Peters
32+
33+
Beautiful is better than ugly.
34+
Explicit is better than implicit.
35+
Simple is better than complex.
36+
Complex is better than complicated.
37+
Flat is better than nested.
38+
Sparse is better than dense.
39+
Readability counts.
40+
Special cases aren't special enough to break the rules.
41+
Although practicality beats purity.
42+
Errors should never pass silently.
43+
Unless explicitly silenced.
44+
In the face of ambiguity, refuse the temptation to guess.
45+
There should be one-- and preferably only one --obvious way to do it.
46+
Although that way may not be obvious at first unless you're Dutch.
47+
Now is better than never.
48+
Although never is often better than *right* now.
49+
If the implementation is hard to explain, it's a bad idea.
50+
If the implementation is easy to explain, it may be a good idea.
51+
Namespaces are one honking great idea -- let's do more of those!
52+
```
53+
54+
This is what is known as the [Zen of Python](http://www.python.org/dev/peps/pep-0020/), which are the guiding principles of Python. These 19 guidelines can be trimmed to five points:
55+
1. Beautiful is better than ugly.
56+
2. Explicit is better than implicit.
57+
3. Simple is better than complex.
58+
4. Complex is better than complicated.
59+
5. Readability counts.
60+
61+
Essentially, Pythonists value code readability and productivity over all else.
62+
63+
> Check out [this](http://stackoverflow.com/questions/228181/the-zen-of-python) StackOverflow question to see examples of all the guidelines in use.
64+
65+
Finally, if shortened to one major point-
66+
67+
*There should be one – and preferably only one – obvious way to do it*
68+
69+
-we get to one of the main differences between Python and Ruby ..
70+
71+
### The Python Way

0 commit comments

Comments
 (0)