Computer Science
What are tokens in Python ? How many types of tokens are allowed in Python ? Exemplify your answer.
Python Funda
67 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
32 Likes
Related Questions
What are literals in Python ? How many types of literals are allowed in Python ?
How are floating constants represented in Python ? Give examples to support your answer.
How are keywords different from identifiers ?
Can nongraphic characters be used in Python ? How ? Give examples to support your answer.