CBSE Class 11 Computer Science Question 5 of 98

Python Programming Fundamentals — Question 5

Back to all questions
5
Question

Question 5

Assertion (A): A set of valid characters recognized by Python constitutes a character set.

Reasoning (R): Character set in Python is a subset of Python tokens.

  1. Both A and R are true and R is the correct explanation of A.
  2. Both A and R are true but R is not the correct explanation of A.
  3. A is true but R is false.
  4. A is false but R is true.
Answer

A is true but R is false.

Explanation
Character set is a set of valid characters recognized by Python. A character represents any letter, digit or any other symbol present on the keyword. On the other hand, a token is the smallest element of a Python script that is meaningful to the interpreter which includes keywords, identifiers, literals, operators and delimiters/punctuators. A character set can be used to form tokens, but not all tokens are part of the character set.