Q17 and 18 are ASSERTION AND REASONING based questions. Mark the correct choice as

(a) Both A and R are true and R is the correct explanation for A

(b)Both A and R are true and R is not the correct explanation for A

(c) A is True but R is False

(d)A is false but R is True

 

Assertion(A): List is an immutable data type

Reasoning(R): When an attempt is made to update the value of an immutable variable, the old variable is destroyed and a new variable is created by the same name in memory.

Answer

Answer by student

(d) A is false but R is true

Detailed answer by teachoo

-lock-

  • The assertion (A) is false because list is a mutable data type, not an immutable one. This means that the elements of a list can be changed or modified without creating a new list object. For example:

[Assertion Reasoning] Assertion(A): List is an immutable data type - CBSE Class 12 Sample Paper for 2024 Boards

As you can see, the list object numbers were not destroyed or replaced by a new one. It was simply updated with a new value at index 0.

  • The reasoning (R) is true because it describes the behavior of an immutable data type, such as a string or a tuple. When an attempt is made to update the value of an immutable variable, the old variable is destroyed and a new variable is created by the same name in memory. For example:

part 2 - Question 17 [Assertion Reasoning] - CBSE Class 12 Sample Paper for 2024 Boards - Solutions to CBSE Sample Paper - Computer Science Class 12 - Computer Science - Class 12

As you can see, the string object name cannot be modified in place. It is an immutable data type that does not allow item assignment. If we want to change the value of name , we have to create a new string object and assign it to the same variable name. For example:

part 3 - Question 17 [Assertion Reasoning] - CBSE Class 12 Sample Paper for 2024 Boards - Solutions to CBSE Sample Paper - Computer Science Class 12 - Computer Science - Class 12

As you can see, the original string object name was destroyed and replaced by a new one with a different value.

  • Therefore, the correct choice is (d) A is false but R is true. The assertion is false and the reasoning is true . The assertion is about lists, which are mutable data types, while the reasoning is about immutable data types.

So, the correct answer is (d) A is false but R is true.

-endlock-

Remove Ads
Teachoo · Class 12 Explore Class 12
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh is an IIT Kanpur graduate and has been teaching for 16+ years. At Teachoo, he breaks down Maths, Science and Computer Science into simple steps so students understand concepts deeply and score with confidence.

Many students prefer Teachoo Black for a smooth, ad-free learning experience.