One of the principles, "There should be one-- and preferably only one --obvious way to do it", can be referenced as the "Pythonic" way.<ref name=":0" /> The official definition of "Pythonic" is:<ref name=":1">{{Cite web |title=Glossary |url=https://docs.python.org/3/glossary.html#term-Pythonic |access-date=2024-02-07 |website=Python Documentation |language=en}}</ref>{{efn|This definition below is directly quoted to preserve its definition. So as is, it is not self-contained valid Python to run without errors.}}
<blockquote>An idea or piece of code which closely follows the most common idioms of the Python language, rather than implementing code using concepts common to other languages. For example, a common idiom in Python is to loop over all elements of an iterable using a <code>for</code> statement. Many other languages don’t have this type of construct, so people unfamiliar with Python sometimes use a numerical counter instead:
<syntaxhighlight lang="python">
for i in range(len(food)):
Line 71 ⟶ 73:
== In practice ==
Since the release of the Zen of Python, there has been research done on its effectiveness and actual use among [[Developer (software)|developers]]. Despite the difference in [[Interpretation (logic)|interpretation]] between beginners and [[Experience|experienced]] Python [[Programmer|programmers]], interviews among 13 Python programmers of varying skill show that the Zen of Python "positively influences the way developers write and talk about code".<ref name=":0">{{Cite book |last1=Alexandru |first1=Carol V. |last2=Merchante |first2=José J. |last3=Panichella |first3=Sebastiano |last4=Proksch |first4=Sebastian |last5=Gall |first5=Harald C. |last6=Robles |first6=Gregorio |chapter=On the usage of pythonic idioms |date=2018-10-24 |title=Proceedings of the 2018 ACM SIGPLAN International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software |chapter-url=https://doi.org/10.1145/3276954.3276960 |series=Onward! 2018 |___location=New York, NY, USA |publisher=Association for Computing Machinery |pages=1–11 |doi=10.1145/3276954.3276960 |isbn=978-1-4503-6031-9 |s2cid=53057358 |oclc=1362712424 |url=https://www.zora.uzh.ch/id/eprint/156901/1/paper.pdf |chapter-url-access=registration |archive-url=https://doiweb.archive.org/10.5167web/20240324015819/https://www.zora.uzh-.ch/id/eprint/156901/1/paper.pdf |archive-date=20182024-1003-0324 |access-date=2024-02-19 |url-status=bot: unknown }}</ref> Researchers extended this [[case study]] to explore the use of Python [[IdiomProgramming idiom|idioms]] on [[GitHub]] repositories, and found that the usage of "Pythonic idioms"{{Efn|A list of their Pythonic idioms can be found here https://slimshadyiam.github.io/ZenYourPython/}} increased over time.<ref>{{Cite book |last1=Farooq |first1=Aamir |last2=Zaytsev |first2=Vadim |chapter=There is more than one way to zen your Python |date=2021-11-22 |title=Proceedings of the 14th ACM SIGPLAN International Conference on Software Language Engineering |chapter-url=https://dl.acm.org/doi/10.1145/3486608.3486909 |series=SLE 2021 |___location=New York, NY, USA |publisher=Association for Computing Machinery |pages=68–82 |doi=10.1145/3486608.3486909 |isbn=978-1-4503-9111-5}}</ref> Writing Python code that aligns with the Zen of Python may save [[Computer memory|memory]] and [[Execution (computing)|run time]] of Python programs.<ref>{{Cite book |last1=Leelaprute |first1=Pattara |last2=Chinthanet |first2=Bodin |last3=Wattanakriengkrai |first3=Supatsara |last4=Kula |first4=Raula Gaikovina |last5=Jaisri |first5=Pongchai |last6=Ishio |first6=Takashi |chapter=Does coding in Pythonic zen peak performance?: Preliminary experiments of nine Pythonic idioms at scale |date=2022-10-20 |title=Proceedings of the 30th IEEE/ACM International Conference on Program Comprehension |chapter-url=https://doi.org/10.1145/3524610.3527879 |series=ICPC '22 |___location=New York, NY, USA |publisher=Association for Computing Machinery |pages=575–579 |doi=10.1145/3524610.3527879 |isbn=978-1-4503-9298-3}}</ref> The [[desire]] to write in Pythonic code has led to [[Code refactoring|refactoring]] tools to help programmers achieve this goal.<ref>{{Citation |last1=Zhang |first1=Zejun |title=Making Python Code Idiomatic by Automatic Refactoring Non-Idiomatic Python Code with Pythonic Idioms |date=2022-07-12 |arxiv=2207.05613 |last2=Xing |first2=Zhenchang |last3=Xia |first3=Xin |last4=Xu |first4=Xiwei |last5=Zhu |first5=Liming}}</ref><ref>{{Citation |last1=Phan-udom |first1=Purit |title=Teddy: Automatic Recommendation of Pythonic Idiom Usage For Pull-Based Software Projects |date=2020-09-05 |arxiv=2009.03302 |last2=Wattanakul |first2=Naruedon |last3=Sakulniwat |first3=Tattiya |last4=Ragkhitwetsagul |first4=Chaiyong |last5=Sunetnanta |first5=Thanwadee |last6=Choetkiertikul |first6=Morakot |last7=Kula |first7=Raula Gaikovina}}</ref>