Tokens in Python
What is Tokens ?
The smallest individual unit in a program is known as Tokens or lexical unit.
Python provides five types of Tokens:--
- Keyword
- Identifier
- Literals
- Punctuators
- Operators
Keyword:-
- words conveys special meaning.
- these are reserved for special purposes.
- not be used as normal identifier names.
- there are 48 keywords in java whereas in python there is 33 keywords.
- these are the building blocks of the program.
- used as the general terminology for the names given to different parts of the program.
- examples---variables, list, dict, numpy array, etc.
Literals:--
- literals are data items that have fixed value.
"There are mainly five types of Literals in Python"
Operators:--
- operators are tokens that trigger some computation.
- can be applied to variables and other objects in an expression.
"There are total seven operators in Python:--"
Punctuators:--
Comments
Post a Comment