CBSE Class 11 Computer Science Question 2 of 82

Lists in Python — Question 2

Back to all questions
2
Question

Question 2

Consider the given two statements:

T1 = [3, 9, 0, 1, 7]
T2 = [5, 1, 0, 7, 5.5]

Assertion (A): Output of print(len(T1) == len(T2)) is True.

Reasoning (R): Method len() returns the number of elements in the list.

  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

Both A and R are true and R is the correct explanation of A.

Explanation
The len() function returns the number of elements in a list. For T1, the length is 5, and for T2, the length is also 5. Since both lists have the same number of elements, len(T1) == len(T2) evaluates to True.