Python PEP 8 Style
Multiple Choice Easy
Question
According to PEP 8, how should a function name be written?
Hint
PEP 8 uses lowercase with underscores for functions.
Explanation
PEP 8 recommends snake_case (lowercase with underscores) for function and variable names, PascalCase for class names, and UPPER_SNAKE_CASE for constants. camelCase is common in JavaScript but not Pythonic.
Related Resources
Related Lessons
- Python Best Practices
PEP 8 conventions.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.