🐍 Python snake_case Guide
PEP 8 compliant naming convention. The standard for Python variables, functions, and modules.
PEP 8 & snake_case
PEP 8 is Python's official style guide. It mandates snake_case for most identifiers.
# PEP 8 compliant snake_case
user_profile = { ... }
first_name = "John"
# Function definition
def get_user_data():
pass
user_profile = { ... }
first_name = "John"
# Function definition
def get_user_data():
pass
📋 PEP 8 Quick Reference:
- Variables:
lower_case_with_underscores - Functions:
lower_case_with_underscores - Methods:
lower_case_with_underscores - Constants:
UPPER_CASE_WITH_UNDERSCORES - Classes:
CapitalizedWords(PascalCase)
Try It: Convert to snake_case
Enter text above...