The Zen Of Python – Tim Peters
Beautiful is better than ugly.
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.
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!
1.1 Why Read This Book?
You need this book because you need to learn Python. Here are a few reasons why you might need to learn
Python
• You need a programming language which is easy to read and has a vast library of modules focused on
solving the problems you’re faced with.
• You saw an article about Python specifically, or dynamic languages in general, and want to learn more.
• You’re starting a project where Python will be used or is in use.
• A colleague has suggested that you look into Python.
• You’ve run across a Python code sample on the web and need to learn more.
Python reflects a number of growing trends in software development, putting it at or near the leading edge of
good programming languages. It is a very simple language surrounded by a vast library of add-on modules.
It is an open source project, supported by many individuals. It is an object-oriented language, binding data
and processing into class definitions. It is a platform-independent, scripted language, with complete access