KnowledgeBoat Logo
|

Computer Science

Assertion (A): Tuple in Python is an ordered and immutable data type.

Reasoning (R): Tuples can contain heterogenous data and permit duplicate values as well.

  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.

Python Tuples

2 Likes

Answer

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

Explanation
Tuples in Python are ordered, meaning elements are arranged in a specific sequence, and this order cannot be changed. Tuples are immutable, so once a tuple is created, we cannot add, change, or update its elements. Duplicate values can be included in a tuple. Additionally, a tuple can hold values of different data types, making it heterogeneous in nature.

Answered By

2 Likes


Related Questions