About Lesson
Identifier is a name of a program element assigned by the developer. In other words, we can say identifiers are the keywords defined user while keywords are the identifiers defined by the language. Program element can be a variable, array, function, module or object etc.
The developer should keep in mind the following conditions while assigning an identifier to his program elements.
- Keywords should not be used as identifiers.
- The first letter of identifier must start with a letter (A-Z or a-z) or Underscore(_) but second letter onwards there can be letters and numbers.
- Any symbols(*,&,% etc) and punctuation marks(space, comma etc) are not allowed in identifier.
- Python is a case sensitive programming language. The identifier ‘A’ is different than ‘a’
- Class names must start with an uppercase letter.
- Starting an identifier with a single leading underscore indicates that the identifier is private.
- Starting an identifier with two leading underscores indicates a strongly private identifier.
- If the identifier also ends with two trailing underscores, the identifier is a language-defined special name.