Skip to main content
Loading page…
Python Mastery
Chapter 21
Lesson 2 of 4
The Zen, PEP 8 & Naming
Contents
Notes
Tutor
Concept
PEP 20: The Zen of Python
Loading activity…
Previous
1 / 10
Continue
Contents
Notes
Discussion
Tutor
22 min
10 activities
0 of 10 done
In this lesson
1
PEP 20: The Zen of Python
2
PEP 8 Essentials: The Rules You Must Know
3
Naming That Communicates
4
Docstrings and Comments That Earn Their Place
5
Before/After: Naming and Docstrings
6
PEP 8: Correct None Comparison
7
PEP 20 in Practice
8
Name This Function
9
Tip: Let Black Do the Formatting
10
When Rules Should Be Broken
Objectives
Recite and apply the most important PEP 20 aphorisms
Follow PEP 8 rules for naming, whitespace, and line length
Choose names that communicate intent without comments
Write docstrings that earn their place
Identify when breaking a style rule is justified
Chapter 21 · Pythonic Idioms & Writing Beautiful Code
Core Python Idioms
The Zen, PEP 8 & Naming
Common Anti-Patterns (and Fixes)
Refactoring to Pythonic Code
Previous: Core Python Idioms
Next: Common Anti-Patterns (and Fixes)