# The Zen of Python

by 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!

## Key Principles Explained

### Beautiful is better than ugly
Write code that is aesthetically pleasing and well-structured.

### Explicit is better than implicit
Make your intentions clear in your code. Don't rely on implicit behavior.

### Simple is better than complex
Choose simple solutions over complex ones when possible.

### Complex is better than complicated
If complexity is necessary, keep it manageable and understandable.

### Flat is better than nested
Avoid deep nesting of code structures. Flat structures are easier to read.

### Sparse is better than dense
Don't try to pack too much into a single line or expression.

### Readability counts
Code is read more often than it's written. Optimize for readability.

### Special cases aren't special enough to break the rules
Maintain consistency even when dealing with edge cases.

### Although practicality beats purity
Sometimes practical solutions are better than theoretically pure ones.

### Errors should never pass silently
Handle errors explicitly and visibly.

### Unless explicitly silenced
If you intentionally ignore an error, make it clear that it's intentional.

### In the face of ambiguity, refuse the temptation to guess
When unclear, ask for clarification rather than making assumptions.

### There should be one-- and preferably only one --obvious way to do it
Python aims for having one clear way to accomplish tasks.

### Although that way may not be obvious at first unless you're Dutch
A nod to Python's creator, Guido van Rossum, who is Dutch.

### Now is better than never
Don't procrastinate on necessary improvements.

### Although never is often better than *right* now
But don't rush into poorly thought-out solutions.

### If the implementation is hard to explain, it's a bad idea
Complex implementations that can't be explained simply are likely flawed.

### If the implementation is easy to explain, it may be a good idea
Simple, explainable solutions are often the best.

### Namespaces are one honking great idea -- let's do more of those!
Use namespaces to organize code and avoid naming conflicts.
