Assertion (A) and Reason (R) based questions. Mark the correct choice as:…

2025

Assertion (A) and Reason (R) based questions. Mark the correct choice as: Assertion (A): Every object in Python is assigned a unique identity (ID). Reason (R): ID remains the same for the lifetime of that object.

  1. A.

    Both Assertion (A) and Reason (R) are true and Reason (R) is the correct explanation of Assertion (A).

  2. B.

    Both Assertion (A) and Reason (R) are true, but Reason (R) is not the correct explanation of Assertion (A).

  3. C.

    Assertion (A) is true, but Reason (R) is false.

  4. D.

    Assertion (A) is false, but Reason (R) is true.

Attempted by 1140 students.

Show answer & explanation

Correct answer: A

In Python, every object is assigned a unique identifier (ID) using the built-in id() function. This ID is unique to the object and remains constant throughout its lifetime, even if the object's value changes. For example, if you create a list and modify its contents, the ID of the list object does not change. This means that both the Assertion (A) and Reason (R) are true. Furthermore, the reason (R) correctly explains why the assertion (A) is true, as the ID remains the same for the object's lifetime. Therefore, the correct choice is the one where both A and R are true, and R is the correct explanation of A.

हिन्दी उत्तर: पायथन में प्रत्येक ऑब्जेक्ट को id() फंक्शन का उपयोग करके एक अद्वितीय पहचान (ID) दी जाती है। यह ID ऑब्जेक्ट के जीवनकाल के दौरान अपरिवर्तित रहता है, भले ही ऑब्जेक्ट का मान बदल जाए। उदाहरण के लिए, यदि आप एक सूची बनाते हैं और उसकी सामग्री में बदलाव करते हैं, तो सूची ऑब्जेक्ट का ID नहीं बदलता है। इसलिए, कथन (A) और कारण (R) दोनों सत्य हैं। इसके अलावा, कारण (R) सही तरीके से स्पष्ट करता है कि कथन (A) क्यों सत्य है, क्योंकि ID ऑब्जेक्ट के जीवनकाल के दौरान समान रहता है। इसलिए, सही विकल्प वह है जहाँ दोनों A और R सत्य हैं, और R कथन (A) का सही स्पष्टीकरण है।

Explore the full course: Bpsc