Zen of Python


Beautiful is better than ugly. (Do things in a pretty way)

Explicit is better than implicit. (Make it so it is understandable for someone else)

Simple is better than complex. (Figure out the easiest solution for a problem)

Complex is better than complicated. (Don’t make it hard)

Flat is better than nested. (Don’t nest unnecessarily)

Sparse is better than dense. (Split the problem into smaller problems)

Readability counts. (Make it easy to read)

Special cases aren’t special enough to break the rules. (Rules matter!)

Although practicality beats purity. (Be practical)

Errors should never pass silently. (Debug)

Unless explicitly silenced. (Unless!)

In the face of ambiguity, refuse the temptation to guess. (Do not assume)

There should be one—and preferably only one—obvious way to do it. (Think simple)

Although that way may not be obvious at first unless you’re Dutch. (Duh)

Now is better than never. (Just do it!)

Although never is often better than right now. (Easter egg)

If the implementation is hard to explain, it’s a bad idea. (Keep it simple!)

If the implementation is easy to explain, it may be a good idea. (Yei!)

Namespaces are one honking great idea—let’s do more of those! (Wuuuuuuu)

One thought on “Zen of Python

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s