Identifiers are names used to identify a variable, function, or other entities in a program.
The rules for naming an identifier in Python are as follows:
- The name should begin with an uppercase or a lowercase alphabet or an underscore sign (_). This may be followed by any combination of characters a–z, A–Z, 0–9 or underscore (_). Thus, an identifier cannot start with a digit.
- It can be of any length .
- It should not be a keyword or reserved word .
- We cannot use special symbols like !, @, #, $, %, etc., in identifiers.
Examples of identifiers:
- area
- _breadth
- mark_1