What are the rules for identifier names?
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.