Codementor Events

The Zen of Python

Published Jan 15, 2021
The Zen of Python

Python is an interpreted, high-level and general-purpose programming language, invented by Dutch programmer Guido van Rossum.

There are 19 aphorisms that describe how you can write clean and beautiful code as a pythoneer. Those 19 aphorisms known as "Zen of Python" are listed below.

  1. Beautiful is better than ugly.
  2. Explicit is better than implicit.
  3. Simple is better than complex.
  4. Complex is better than complicated.
  5. Flat is better than nested.
  6. Sparse is better than dense.
  7. Readability counts.
  8. Special cases aren't special enough to break the rules.
  9. Although practicality beats purity.
  10. Errors should never pass silently.
  11. Unless explicitly silenced.
  12. In the face of ambiguity, refuse the temptation to guess.
  13. There should be one-- and preferably only one --obvious way to do it.
  14. Although that way may not be obvious at first unless you're Dutch.
  15. Now is better than never.
  16. Although never is often better than right now.
  17. If the implementation is hard to explain, it's a bad idea.
  18. If the implementation is easy to explain, it may be a good idea.
  19. Namespaces are one honking great idea -- let's do more of those!

All aphorisms above are simple, clean like Python itself ))

Millions of developers use python, code in python, analyze data with python, and build models using python. The guidelines made for it only motivates programmers to write simple, readable, and clean code.

PS: Python is TIOBE's Programming Language of 2020
Python has won the TIOBE programming language of the year award. This is for the fourth time in the history, which is a record. The title is awarded to the programming language that has gained most popularity in one year. Python made a positive jump of 2.01% in 2020.

Discover and read more posts from Ozodbek Kamolov
get started
post commentsBe the first to share your opinion
Show more replies