Question:
Which of the given options best describes the truthfulness of the following statements?
i) A tuple is a sequence of immutable Python objects, in the given tuple course = “l”, “m”, “n”, “o”, has four elements.
ii) To explicitly remove an entire tuple, use the drop statement.
दिए गए विकल्पों में से कौन सा विकल्प निम्नलिखित कथनों की सत्यता का सबसे अच्छा वर्णन करता है?
i) टपल (tuple), अपरिवर्त्य पायथन ऑब्जेक्ट्स का एक अनुक्रम होता है, दिए गए टपल कोर्स = “l”, “m”, “n”, “o”, में चार एलीमेंट हैं।
ii) संपूर्ण टपल को स्पष्ट रूप से हटाने के लिए, ड्रॉप स्टेटमेंट का उपयोग कीजिए।
Options:
- i-True, ii-True
- i-False, ii-True
- i-True, ii-False
- i-False, ii-False
- i-सत्य, ii-सत्य
- i-असत्य, ii-सत्य
- i-सत्य, ii-असत्य
- i-असत्य, ii-असत्य
Correct Answer: c)
Explanation:
Analyzing both statements in Python:
– Statement (i) is True: A tuple is an ordered, immutable sequence of Python objects. Tuple packing allows comma-separated items without parentheses: `course = “l”, “m”, “n”, “o”` creates a valid tuple with four string elements (`(‘l’, ‘m’, ‘n’, ‘o’)`).
– Statement (ii) is False: Python does NOT have a `drop` statement. To explicitly delete an entire variable or tuple from memory, Python provides the `del` statement (e.g., `del course`). Individual elements cannot be deleted due to immutability, but the entire tuple object can be deleted using `del`.
Therefore, statement (i) is True and statement (ii) is False.
पायथन में कथनों का विश्लेषण:
– कथन (i) सत्य है: टपल (tuple) अपरिवर्तनीय (immutable) ऑब्जेक्ट्स का एक अनुक्रम होता है। बिना कोष्ठक के कॉमा द्वारा अलग किए गए मान जैसे `course = “l”, “m”, “n”, “o”` चार तत्वों वाला एक वैध टपल बनाते हैं।
– कथन (ii) असत्य है: पायथन में किसी ऑब्जेक्ट को हटाने के लिए `drop` नामक कोई स्टेटमेंट नहीं होता है। किसी पूरे टपल को डिलीट करने के लिए `del` कीवर्ड का उपयोग किया जाता है (जैसे: `del course`)।
अतः कथन i-सत्य है तथा ii-असत्य है।