The Zen of Python is a poem by Tim Peters that is meant to be a guiding principle when writing Python code. In this lesson, you learned how to launch this poem in a Python shell.
Hint: You can adjust the default video playback speed in your account settings.
Hint: You can set the default subtitles language in your account settings.
Sorry! Looks like there’s an issue with video playback 🙁 This might be due to a temporary outage or because of a configuration issue with your browser. Please see our video player troubleshooting guide to resolve the issue.
Intro and the Zen of Python
00:00 I’d like to talk about idioms or best practices in Python. You’ll often hear Python developers ask one another how Pythonic a piece of code is. They’re simply referring to how idiomatic this piece of code is for solving problems in Python.
00:15
We can’t have a talk about Python idioms without first mentioning The Zen of Python by Tim Peters. This poem can be reached in any recent distribution of Python by simply typing in python -m this
.
00:30 This poem is meant to be a guiding light or guiding principle when writing Python code. I would definitely give it a read.
00:39 Let’s launch up the editor and get to some actual programming idioms.
Become a Member to join the conversation.