AI engineering glossary · Python core

What is PEP 8?

PEP 8: Python's official style guide, which sets conventions such as four-space indentation, lowercase_with_underscores names for functions and variables, and a maximum line length of 79 characters. Following it makes code consistent across teams.

Level: intermediateTopic: Python core

PEP 8: an example

A function named calculate_total follows PEP 8, while CalculateTotal or calcTotal for a function does not.

Related terms

More Python core terms

Where you learn it

PEP 8 is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.