CBSE Class 12 Computer Science Question 47 of 105

Python Revision Tour — Question 1

Back to all questions
1
Question

Question 1

What are tokens in Python? How many types of tokens are allowed in Python? Exemplify your answer.

Answer

The smallest individual unit in a program is known as a Token. Python has following tokens:

  1. Keywords — Examples are import, for, in, while, etc.
  2. Identifiers — Examples are MyFile, _DS, DATE_9_7_77, etc.
  3. Literals — Examples are "abc", 5, 28.5, etc.
  4. Operators — Examples are +, -, >, or, etc.
  5. Punctuators — ' " # () etc.