PEP 8 defines the style guide for Python code.
Its title is “Style Guide for Python Code,” and the document describes conventions intended to make Python programs more readable and consistent. PEP 8 covers indentation, line length, imports, whitespace, naming, comments, docstrings, and programming recommendations. It is especially influential in the Python standard library and across the wider Python ecosystem.
PEP 8 was created in 2001 by Guido van Rossum, Barry Warsaw, and Alyssa Coghlan. It is an informational PEP rather than a language feature specification, so following it does not change how Python is interpreted. Projects can adopt their own conventions when local needs differ, although consistency within a project remains the central goal.
The distractors point to nearby but distinct documents. PEP 257 concerns docstring conventions, PEP 484 introduced type hints, and PEP 20 is “The Zen of Python,” a set of guiding aphorisms rather than a full formatting guide. PEP 8 also recommends four spaces per indentation level and traditionally sets a 79-character limit for code lines.