What is identifier in python?
The smallest individual unit in a program is known as a token or a lexical unit. Python has following tokens:-
- Keywords
- Identifiers
- Literals
- Operators
- Punctuations
Identifiers are fundamental building blocks of a program and are used as the general terminology for the names given to different parts of the program like variables, objects, classes, functions, lists, dictionaries, etc.
- First character of identifier must be a letter or an underscore.
- No special characters should be used in identifier except underscore.
- You can use 0 to 9 numbers in identifiers but not in first character.
- It should not be a predefined name in python.
- Upper case and lower case characters are different .
e.g.,
List1, l1, father_name, etc.
This is all about identifiers.
Subscribe
Login
Please login to comment
0 Discussion