Intro and the Zen of Python
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.
Note: This course uses Python 2.7 in its coding examples. For Python 3 examples, you can check out the Writing Idiomatic Python video course.
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.