snake_case
Writing a multi-word name in lower case with underscores between words, as in tell_story, the Python standard for functions and variables.
In more detail
PEP 8 recommends snake_case for functions, methods and variables, CapWords for classes and UPPER_CASE for constants. Linters such as ruff can warn when names break the convention.
Related terms
- camelCase — Writing a multi-word name with each later word capitalised and no spaces, as in tellStory or getKeys.
- PEP 8 — The official style guide for Python code, covering layout, naming and common idioms.
- constant — A name for a value that is set once and is not meant to change while the program runs.
Taught in
- Literals, Identifiers And Keywords — Hands-on Python: Complete Video Course & Book
- Formatting, Linting And Style — Hands-on Python: Complete Video Course & Book
- Literals, Names And Four Number Bases — PCEP Certified Entry-Level Python Programmer (PCEP-30-02) Exam Prep