Question 94Asked in Bihar STET 2025 Paper II Computer Science, 7 Nov 2025, Shift 1 (9:00 AM)

If the dictionary D1 is defined as: D1 = {1: 'a', 2: 'b'}यदि dictionary D1 को इस रूप में परिभाषित किया जाता है:

If the dictionary D1 is defined as: D1 = {1: 'a', 2: 'b'} then which of the following statements is incorrect and hence will result in an error?
यदि dictionary D1 को इस रूप में परिभाषित किया जाता है: D1 = {1: 'a', 2: 'b'} तो निम्‍नलिखित कथनों में से कौन-सा गलत कथन है और उसके परिणामस्‍वरूप एक error है?
  1. AD1 . get (1)D1 . get (1)
  2. BD1 . get (3)D1 . get (3)
  3. CD1 .del (1)D1 .del (1)
  4. DD1 . clear (1)D1 . clear (1)
Show answerHide answer

Correct answer: (C) D1 .del (1)D1 .del (1)

Explanation

Python dictionaries have no del method, so D1.del(1) is invalid. Deleting a key is done with the statement del D1[1]. D1.clear(1) would also fail, because clear() takes no arguments.Python dictionary में del मेथड नहीं होती, इसलिए D1.del(1) अमान्य है। key हटाने के लिए कथन del D1[1] है। D1.clear(1) भी विफल होता, क्योंकि clear() कोई आर्गुमेंट नहीं लेता।

From Bihar STET 2025 Paper II Computer Science PYQ, 7 Nov 2025, Shift 1 (9:00 AM)

This is question 94 of Bihar STET 2025 Paper II Computer Science PYQ, 7 Nov 2025, Shift 1 (9:00 AM). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.