Search⌘ K
AI Features

Identifier Naming Convention

Explore the conventions for naming identifiers in Python, including variables, functions, and class attributes. Understand how to use lowercase, underscores, and capitalization to indicate variable scope and accessibility, enhancing code clarity and organization.

We have created identifiers for many things—normal variables, functions, classes, instance data, instance methods, class data, and class methods.

It’s a good idea to adhere to the following conventions when creating identifiers.

Variables and functions not belonging to a class

All variables and functions not belonging to a class start with a lowercase alphabet.

For example: real, imag, name, age, ...