The Zen of Python: 19 Timeless Principles for Elegant Coding (PEP-20)
One of the earliest Python pep’s is PEP-20. It’s a list of 19 theses relating to Python programming called ‘The Zen of Python.’ These rules date back to 2004 and are in turn based on PEP-8.
A little Easter egg that has been present in Python for a long time lists these 19 rules:
>>> import this 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!
So as long as you have a Python REPL, you can get these rules on your screen!
Python
- Enhanced Edge Audio Processing for Voice-Activated Devices
- Python vs PHP: Key Differences, Strengths, and Choosing the Right Language
- Python vs. Go: Which Language Wins for Your Project?
- Python 2 vs Python 3: Key Differences and Choosing the Right Version
- Python vs. C++: Key Differences & Which Is Right for You
- Python Data Classes: Streamline Data Management with Modern Syntax
- Plasma Cutting vs Laser Cutting: Choosing the Right Technique for Your Project
- Python’s Growing Role in Embedded Systems: Why It Matters
- Master the BJT Load Line: A Clear Guide to Transistor Amplification and Switching
- Master Raspberry Pi GPIO with Python: Step‑by‑Step Tutorial