Zen of Python

The Zen of Python is a collection of 19 "guiding principles" for writing computer programs that influence the design of the Python programming language.

Uses your system voice; voice and rate in settings.

Snapshot

≈ 2 min read

Names in other languages

No names in other languages are held for this entry yet.

Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.

The Zen of Python is a collection of 19 "guiding principles" for writing computer programs that influence the design of the Python programming language. Python code that aligns with these principles is often referred to as "Pythonic". Software engineer Tim Peters wrote this set of principles and posted it on the Python mailing list in 1999.

Peters' list left open a 20th principle "for Guido to fill in", referring to Guido van Rossum, the original author of the Python language. The vacancy for a 20th principle has not been filled. Peters' Zen of Python was included as entry number 20 in the language's official Python Enhancement Proposals and was released into the public domain.

It is also included as an Easter egg in the Python interpreter, where it can be displayed by entering import this . In May 2020, Barry Warsaw (developer of GNU Mailman) used it as the lyrics to a song.

Principles

The principles are listed as follows: for i in range(len(food)): print(food[i]) As opposed to the cleaner, Pythonic method: for piece in food: print(piece) Code that is difficult to understand or reads like a rough transcription from another programming language is called unpythonic.

Text derived from https://en.wikipedia.org/w/index.php?oldid=1342844534 under CC BY-SA 4.0; modifications have been made.

Sources cited in this revision

12 named source(s) extracted from the cited revision. A source with no author is shown by its publication; nothing is invented.