Computer Science
What are tokens in Python ? How many types of tokens are allowed in Python ? Exemplify your answer.
Python Funda
70 Likes
Answer
The smallest individual unit in a program is known as a Token. Python has following tokens:
- Keywords — Examples are import, for, in, while, etc.
- Identifiers — Examples are MyFile, DS, DATE9777, etc.
- Literals — Examples are "abc", 5, 28.5, etc.
- Operators — Examples are +, -, >, or, etc.
- Punctuators — ' " # () etc.
Answered By
35 Likes
Related Questions
State whether the following statement is True or False :
A variable can contain values of different types at different times.
State whether the following statement is True or False :
Expressions contain values/variables along with operators.
How are keywords different from identifiers ?
What are literals in Python ? How many types of literals are allowed in Python ?