CBSE Class 12 Computer Science Question 8 of 120

Review of Python Basics — Question 8

Back to all questions
8
Question

Question 8

Assertion (A): There is no difference between a list and a tuple in Python.

Reasoning (R): The list elements are enclosed within square brackets [] separated by commas and the tuple elements are enclosed within parentheses () separated by commas.

  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 false but R is true.

Explanation
Lists are mutable, meaning their elements can be changed after creation, and they are enclosed within square brackets [] separated by commas. On the other hand, tuples are immutable, so their elements cannot be changed after creation, and they are enclosed within parentheses () separated by commas. Hence, list and tuples are not same.