Identifiers are the building blocks of a program. It is generally a name given to a variable, function or class etc.
Following rules are associated while naming identifiers :
1. Identifiers can include letters, numbers, and the underscore character(_).
2. Identifiers can not start with a number.
3. Special symbols are not allowed in identifiers.
Some of the examples are salary, code_21. Since, Python is a case sensitive language so an identifier code is different from code.
Do you know ?
Identifiers can be of any length.
Naming Convention in Python
Naming conventions are the rules defined to name various Python objects
Package : Package names should be written in lowercase letters. In the case of multiple words, separate them using underscore.
Modules : Module names should be written in lowercase letters. In the case of multiple words, separate them using underscore.
Classes : Class should always start with a capital letter. Python’s built-in classes are written in lowercase letters.
Instance variable : Instance variable names should be written in lowercase letters. In the case of multiple words, separate them using underscore. Non public instance variable should begin with underscore.
Global variable : Global variable names should be written in lowercase letters. In the case of multiple words, separate them using underscore.
That’s all, see you in the next lecture.
