Checking your account

You can read the lesson while its saved answers and constructions load. Learning controls will open once that work is ready.

Names, Units, and Readable Code

Python Style and Documentation Conventions

BOTIE

As Python's standard library grew, programmers needed to read and maintain code written by other people. PEP 8 and PEP 257 documented shared naming, layout and documentation conventions in 2001, drawing on earlier Python style guides.

Their purpose was understandable code and consistent expectations. A descriptive name carries information into every use of a value. A docstring records behavior that a name cannot reasonably contain, such as units, an empty-input policy or an exception. The conventions still require judgment about the particular program.

Sources for this history