{SET 2} M3-R5 Paper Practice JULY 2026 Leave a Comment / By Ritu Verma / 11/15/2026 Q. 1. निम्नलिखित में से किन समस्याओं को इटरेटिव प्रोसेसिंग (Iterative Processing / लूप) के माध्यम से हल किया जाता है? Which of the following problems are solved using iterative processing? A. किसी संख्या का फैक्टोरियल निकालना (Computing the factorial of a number) B. प्रथम n संख्याओं का योग निकालना (Finding the sum of first n numbers) C. डेसिमल संख्या को बाइनरी में बदलना (Converting a decimal number to binary) D. दो अचर मानों की साधारण स्वैपिंग (Simple swapping of two variables) (A) A, B, and C only (B) B and D only (C) A and D only (D) D only Correct Answer: (A) A, B, and C only Explanation: फैक्टोरियल (A), n संख्याओं का योग (B) और डेसिमल से बाइनरी रूपांतरण (C) में बार-बार प्रक्रिया दोहराने के लिए लूप (Iterative processing) की आवश्यकता होती है, जबकि दो वेरिएबल्स को बदलने (D) में लूप नहीं लगता। Q. 2. कौन सा Python कांस्टेंट ऐसी वैल्यू को दिखाता है जो किसी भी मान के न होने (Absence of a value / Null) का संकेत देती है? Which Python constant represents the absence of a value? (A) Null (B) Void (C) Empty (D) None Correct Answer: (D) None Explanation: अन्य भाषाओं के Null की तरह Python में किसी मान के न होने या खाली रिटर्न को दर्शाने के लिए विशेष बिल्ट-इन स्थिरांक None का उपयोग किया जाता है। Q. 3. नीचे दो कथन दिए गए हैं: Given below are two statements: अभिकथन (A): फैक्टोरियल की गणना में रिकर्शन (Recursion), इटरेशन (लूप) की तुलना में अधिक मेमोरी कुशल होता है यानी कम मेमोरी लेता है। (Assertion A: In factorial computation, recursion is more memory-efficient than iteration.) कारण (R): रिकर्शन प्रत्येक फंक्शन कॉल के मध्यवर्ती परिणामों को फंक्शन कॉल स्टैक (Call Stack) में स्टोर करता है। (Reason R: Recursion stores intermediate function call states in the function call stack.) (A) (A) is false, but (R) is true (B) Both (A) and (R) are true (C) (A) is true, but (R) is false (D) Both (A) and (R) are false Correct Answer: (A) (A) is false, but (R) is true Explanation: अभिकथन (A) गलत है क्योंकि रिकर्शन कॉल स्टैक में हर कॉल की मेमोरी बनाता है जिससे वह लूप की तुलना में अधिक मेमोरी लेता है (कम मेमोरी कुशल होता है), जबकि कारण (R) बिल्कुल सत्य है। Q. 4. फ्लोचार्ट में निर्णय लेने (Decision Making / Condition Checking) के लिए किस प्रतीक का उपयोग किया जाता है? Which symbol is used for decision making in a flowchart? (A) Oval (B) Rectangle (C) Diamond (D) Parallelogram Correct Answer: (C) Diamond Explanation: फ्लोचार्ट में किसी भी तार्किक शर्त की जांच (Decision Making – True/False) को दिखाने के लिए हीरे के आकार यानी Diamond सिंबल का प्रयोग होता है। Q. 5. नीचे दिए गए Python कोड का आउटपुट क्या होगा? What will be the output of the following Python code? def calc(a, b=3): return a + b print(calc(5)) (A) 8 (B) 5 (C) 3 (D) Error Correct Answer: (A) 8 Explanation: फंक्शन कॉल calc(5) में a का मान 5 पास किया गया है और b अपना डिफ़ॉल्ट मान 3 ले लेगा, जिससे दोनों का योग 5 + 3 = 8 रिटर्न होगा। Q. 6. Python के बिल्ट-इन फंक्शन्स से जुड़े इन कथनों को सही (True) या गलत (False) के तौर पर चिह्नित कीजिए: Mark the following statements related to Python functions as True or False: 1. eval() फंक्शन एक स्ट्रिंग को Python एक्सप्रेशन के रूप में इवैल्यूएट करके परिणाम लौटाता है। 2. strip() मेथड स्ट्रिंग के केवल बाईं ओर (Left side only) के खाली स्पेस को हटाता है। 3. isdigit() मेथड True रिटर्न करता है यदि स्ट्रिंग के सभी कैरेक्टर अंक (Digits) हों। 4. random.random() फंक्शन 0 और 1 के बीच पूर्णांक (Integer) वैल्यू देता है। (A) True, True, False, False (B) False, True, False, True (C) True, False, False, True (D) True, False, True, False Correct Answer: (D) True, False, True, False Explanation: कथन 1 और 3 सही हैं; कथन 2 गलत है क्योंकि strip() दोनों तरफ के स्पेस हटाता है, और कथन 4 गलत है क्योंकि random.random() 0.0 से 1.0 के बीच फ्लोट (Float) मान देता है। Q. 7. जब किसी मौजूदा फाइल को ‘w+’ मोड में खोला जाता है, तो क्या होता है? What happens when an existing file is opened in ‘w+’ mode in Python? (A) The file is opened for reading only (B) New data is appended at the end without deleting existing content (C) The file is opened for both reading and writing, and its existing content is erased/truncated (D) Python raises a FileExistsError Correct Answer: (C) The file is opened for both reading and writing, and its existing content is erased/truncated Explanation: ‘w+’ मोड फाइल को रीडिंग और राइटिंग दोनों के लिए खोलता है, लेकिन यदि फाइल पहले से मौजूद हो तो उसके पुराने कंटेंट को पूरी तरह मिटा (Truncate/Overwrite कर) देता है। Q. 8. LEGB नियम के अनुसार अगर कोई वेरिएबल नाम Local, Enclosing और Global स्कोप तीनों में नहीं मिलता है, तो Python उसे अंत में कहाँ ढूंढेगा? If a variable is not found in Local, Enclosing, or Global scope, where will Python look for it last? (A) Hardware BIOS (B) External CSS file (C) Built-in scope (D) Recycle Bin Correct Answer: (C) Built-in scope Explanation: LEGB (Local -> Enclosing -> Global -> Built-in) नियम के अनुसार यदि वेरिएबल पहले तीन स्कोप में नहीं मिलता, तो अंत में उसे Built-in स्कोप में खोजा जाता है (और वहां भी न मिलने पर NameError आता है)। Q. 9. नीचे दिए गए Python कोड का आउटपुट क्या होगा? What will be the output of the following Python code? a = [1, 2, 3] b = a a.append(4) print(b) (A) [1, 2, 3] (B) [4] (C) Error (D) [1, 2, 3, 4] Correct Answer: (D) [1, 2, 3, 4] Explanation: b = a करने से दोनों वेरिएबल मेमोरी की एक ही लिस्ट को संदर्भित करते हैं, इसलिए a में 4 अपेंड करने पर b प्रिंट करने से भी [1, 2, 3, 4] मिलेगा। Q. 10. दशमलव संख्या 25 (Decimal 25) को बाइनरी में बदलने पर उसका सही बाइनरी निरूपण क्या होगा? What is the correct binary representation of the decimal number 25? (A) 11001 (B) 10011 (C) 11100 (D) 10101 Correct Answer: (A) 11001 Explanation: दशमलव 25 को बाइनरी में बदलने पर (16 + 8 + 0 + 0 + 1 = 25) बाइनरी संख्या 11001 प्राप्त होती है। Q. 11. Python में एक डायनेमिक लिस्ट में ‘n’ एलिमेंट्स को स्टोर/अपेंड करने की स्पेस कॉम्प्लेक्सिटी (Space Complexity) क्या होती है? What is the space complexity of storing/appending ‘n’ elements in a dynamic list in Python? (A) O(1) (B) O(n) (C) O(log n) (D) O(n^2) Correct Answer: (B) O(n) Explanation: लिस्ट में n एलिमेंट्स को स्टोर करने के लिए मेमोरी की आवश्यकता तत्वों की संख्या n के समानुपाती होती है, इसलिए इसकी स्पेस कॉम्प्लेक्सिटी O(n) होती है। Q. 12. पहले से सॉर्ट किए गए (Sorted) एरे या लिस्ट में किसी एलिमेंट को सबसे तेजी से खोजने के लिए कौन सा सर्चिंग एल्गोरिदम सबसे उपयुक्त है? Which searching algorithm is most efficient for searching an element in a sorted array? (A) Linear Search (B) Bubble Sort (C) Random Search (D) Binary Search Correct Answer: (D) Binary Search Explanation: सॉर्टेड एरे में बाइनरी सर्च (Binary Search) हर चरण में सर्च स्पेस को आधा कर देता है और O(log n) समय में सबसे तेजी से एलिमेंट ढूंढ लेता है। Q. 13. Python में Key के माध्यम से किसी एलिमेंट को एक्सेस/लुकअप करने के लिए इनमें से किस डेटा स्ट्रक्चर की औसत केस टाइम कॉम्प्लेक्सिटी (Average-case Time Complexity) O(1) होती है? Which of the following data structures in Python has an average-case time complexity of O(1) for element lookup? (A) Dictionary (and Set) (B) Linked List (C) Unsorted List linear scan (D) Binary Tree Correct Answer: (A) Dictionary (and Set) Explanation: Python की डिक्शनरी आंतरिक रूप से हैश टेबल (Hash Table) पर काम करती है, इसलिए Key की मदद से डेटा खोजने का औसत समय O(1) (Constant time) होता है। Q. 14. नीचे दिए गए रिकर्सिव फैक्टोरियल कोड के बारे में कौन से कथन सही हैं? Which statements are true regarding the following recursive factorial code? def fact(n): if n == 0: return 1 return n * fact(n – 1) 1. यह फंक्शन किसी भी पूर्णांक (यहाँ तक कि ऋणात्मक संख्याओं) के लिए हमेशा सही ढंग से समाप्त होता है। 2. बहुत बड़े धनात्मक मान n के लिए इसमें RecursionError (Maximum recursion depth exceeded) आ सकता है। 3. ऋणात्मक संख्या (Negative n) पास करने पर यह अनंत रिकर्शन (Infinite recursion) में चला जाता है 4. इसके बराबर का इटरेटिव (लूप वाला) सॉल्यूशन रिकर्शन डेप्थ एरर की समस्या से बचाता है। (A) 1 and 2 only (B) 2, 3, and 4 only (C) 1 and 3 only (D) All 1, 2, 3, and 4 Correct Answer: (B) 2, 3, and 4 only Explanation: कथन 1 गलत है क्योंकि ऋणात्मक संख्या पर यह n == 0 पर कभी नहीं रुकेगा; जबकि कथन 2, 3 और 4 पूरी तरह से सत्य हैं। Q. 15. नीचे दो कथन दिए गए हैं: Given below are two statements: अभिकथन (A): फ्लोचार्ट किसी एल्गोरिदम के लॉजिक को चित्रों के माध्यम से विजुअलाइज़ करने और समझने में मदद करता है। (Assertion A: A flowchart helps in visualizing the logic of an algorithm.) कारण (R): फ्लोचार्ट को कंप्यूटर के हार्डवेयर CPU द्वारा बिना किसी कोडिंग के सीधे मशीन कोड की तरह निष्पादित किया जा सकता है। (Reason R: Flowcharts are directly executable by the computer’s CPU.) (A) Both (A) and (R) are true (B) (A) is false, but (R) is true (C) (A) is true, but (R) is false (D) Both (A) and (R) are false Correct Answer: (C) (A) is true, but (R) is false Explanation: अभिकथन (A) सही है कि फ्लोचार्ट लॉजिक का चित्रात्मक रूप है, लेकिन कारण (R) गलत है क्योंकि कंप्यूटर सीधे फ्लोचार्ट को रन नहीं कर सकता, उसके लिए प्रोग्रामिंग भाषा में कोड लिखना पड़ता है। Q. 16. यदि एक ही नाम का वेरिएबल Local, Enclosing और Global तीनों स्कोप में मौजूद है, तो फंक्शन के अंदर उस वेरिएबल को प्रिंट करने पर सबसे पहले किसे चुना जाएगा? If a variable with the same name exists in Local, Enclosing, and Global scopes, which one will be selected first inside the function? (A) Global (B) Enclosing (C) Built-in (D) Local Correct Answer: (D) Local Explanation: LEGB प्राथमिकता नियम के अनुसार यदि समान नाम का वेरिएबल सभी स्कोप में है, तो फंक्शन के अंदर सबसे उच्च प्राथमिकता Local वेरिएबल को मिलती है। Q. 17. एक प्रोग्रामर अभाज्य संख्या (Prime Number) जांचने के लिए संख्या n को 2 से n – 1 तक के सभी पूर्णांकों से भाग देकर देखता है। बड़े नंबर (जैसे n = 9973) के लिए समय बचाने हेतु कौन सा ऑप्टिमाइजेशन लागू करना चाहिए? A programmer checks primality by dividing n by all integers from 2 to n – 1. Which optimization should be applied to make it much faster? (A) Check divisors only from 2 up to √n (square root of n) (B) Check divisors from 2 up to n^2 (C) Divide only by 1 and n (D) Convert the number into a string first Correct Answer: (A) Check divisors only from 2 up to √n (square root of n) Explanation: किसी संख्या का कोई भी गुणनखंड उसके वर्गमूल (√n) से बड़ा जोड़ीदार तभी हो सकता है जब एक गुणनखंड √n या उससे छोटा हो; इसलिए केवल 2 से √n तक भाग देना समय को O(n) से घटाकर O(√n) कर देता है। Q. 18. Python में for लूप के बारे में नीचे दिए गए कथनों में से कौन से कथन सही हैं? Which of the following statements about the for loop in Python are correct? 1. यह लिस्ट, टपल, स्ट्रिंग और range() जैसे किसी भी इटरेबल पर इटरेट कर सकता है। 2. प्रत्येक for लूप के साथ else ब्लॉक लिखना सिंटैक्स के अनुसार अनिवार्य होता है। 3. break स्टेटमेंट लूप को रोकने के बजाय केवल अगले इटरेशन पर स्किप करता है। 4. लूप के साथ लगा else ब्लॉक तभी चलता है जब लूप बिना किसी break स्टेटमेंट के सामान्य रूप से पूरा हो। (A) 1 and 2 only (B) 2 and 3 only (C) 1 and 4 only (D) All 1, 2, 3, and 4 Correct Answer: (C) 1 and 4 only Explanation: कथन 1 और 4 बिल्कुल सत्य हैं; कथन 2 गलत है क्योंकि else वैकल्पिक होता है, और कथन 3 गलत है क्योंकि अगले इटरेशन पर जाने का काम continue करता है, break नहीं। Q. 19. Python में रिकर्शन (Recursion) के बारे में निम्नलिखित में से कौन से कथन सही हैं? Which of the following statements about Recursion in Python are correct? 1. अनंत स्टैक ओवरफ्लो को रोकने के लिए रिकर्शन की डेप्थ डिफ़ॉल्ट रूप से सीमित (लगभग 1000 कॉल्स) होती है। 2. Python इंटरप्रेटर द्वारा टेल रिकर्शन (Tail Recursion) को अपने आप ऑप्टिमाइज़ किया जाता है। 3. sys.setrecursionlimit() की सहायता से रिकर्शन डेप्थ की सीमा को बदला जा सकता है। 4. प्रत्येक रिकर्सिव फंक्शन को उसके जैसा काम करने वाले इटरेटिव (लूप आधारित) फंक्शन में बदला जा सकता है। (A) 1 and 2 only (B) 2 and 4 only (C) 1, 3, and 4 only (D) All 1, 2, 3, and 4 Correct Answer: (C) 1, 3, and 4 only Explanation: कथन 1, 3 और 4 बिल्कुल सही हैं; कथन 2 गलत है क्योंकि मानक Python (CPython) सटीक स्टैक ट्रेस बनाए रखने के लिए Tail Recursion Optimization (TCO) नहीं करता। Q. 20. वेरिएबल स्कोप और मॉड्यूल के संदर्भ में निम्नलिखित में से कौन सा कथन गलत (Incorrect) है? Which of the following statements is INCORRECT regarding variable scope and modules? (A) A variable defined inside a function is local to that function by default (B) The global keyword allows modifying a module-level variable inside a function (C) Each module has its own independent global symbol table (D) A variable declared as global inside one module automatically becomes a built-in global variable across all other imported modules without importing Correct Answer: (D) A variable declared as global inside one module automatically becomes a built-in global variable across all other imported modules without importing Explanation: किसी मॉड्यूल में global घोषित किया गया वेरिएबल केवल उसी मॉड्यूल फाइल के स्तर पर ग्लोबल होता है, वह दूसरे मॉड्यूल्स में अपने आप बिना मॉड्यूल रेफरेंस के ग्लोबल नहीं बनता। Q. 21. Python फाइल हैंडलिंग से जुड़े इन वाक्यों को सही (True) या गलत (False) के तौर पर चिह्नित कीजिए: Mark the following statements related to Python file handling as True or False: 1. tell() मेथड बाइट्स में फाइल पॉइंटर की मौजूदा पोजिशन को बताता है। 2. seek(0) फाइल पॉइंटर को फाइल के सबसे अंत (End of file) में ले जाता है। 3. अगर मौजूदा फाइल को ‘w’ मोड में खोला जाए, तो write() पुराने कंटेंट को ओवरराइट कर देता है। 4. ‘a’ (Append) मोड में खोली गई फाइल खुलते ही पुराने कंटेंट को मिटा (Truncate कर) देती है। (A) True, True, False, False (B) False, True, False, True (C) True, False, True, False (D) False, False, True, True Correct Answer: (C) True, False, True, False Explanation: कथन 1 और 3 सही हैं; कथन 2 गलत है क्योंकि seek(0) शुरुआत में ले जाता है, और कथन 4 गलत है क्योंकि ‘a’ मोड पुराने डेटा को सुरक्षित रखकर अंत में जोड़ता है। Q. 22. Python में फाइल पॉइंटर की वर्तमान स्थिति (Current Position) को वापस करने के लिए कौन सा मेथड उपयोग किया जाता है? Which method is used to return the current position of the file pointer in Python? (A) seek() (B) tell() (C) read() (D) flush() Correct Answer: (B) tell() Explanation: फाइल में कर्सर (File pointer) की वर्तमान बाइट पोजिशन जानने के लिए tell() मेथड का उपयोग किया जाता है। Q. 23. नीचे दिए गए मल्टीपल असाइनमेंट स्टेटमेंट के बारे में कौन से कथन सही हैं? Consider the following statement in Python: a = b = c = 5 अभिकथन (A): स्टेटमेंट a = b = c = 5 तीनों वेरिएबल्स a, b और c को 5 की वैल्यू असाइन करता है। (Assertion A: It assigns the value 5 to all three variables.) कारण (R): Python चेन्ड असाइनमेंट को Strict Left-to-Right क्रम में इवैल्यूएट करके मान बनाता है। (Reason R: Python evaluates the right-hand value first, not left-to-right.) (A) Both (A) and (R) are true (B) (A) is false, but (R) is true (C) (A) is true, but (R) is false (D) Both (A) and (R) are false Correct Answer: (C) (A) is true, but (R) is false Explanation: अभिकथन (A) सही है कि तीनों को मान 5 मिलता है, लेकिन कारण (R) गलत है क्योंकि असाइनमेंट में सबसे पहले दाईं ओर का एक्सप्रेशन (5) इवैल्यूएट होकर वेरिएबल्स को बाइंड होता है। Q. 24. प्रोग्राम डेवलपमेंट का कौन सा चरण प्रोग्राम में मौजूद त्रुटियों (Bugs / Logical Errors) का पता लगाकर उन्हें दूर करने की पुष्टि करता है? Which step of program development involves locating and fixing errors in the code? (A) Flowcharting only (B) Syntax coloring (C) File renaming (D) Debugging Correct Answer: (D) Debugging Explanation: प्रोग्राम में सिंटैक्स या लॉजिकल गलतियों को ट्रैक करके उन्हें सुधारने के चरण को डीबगिंग (Debugging) कहा जाता है। Q. 25. निम्नलिखित Python कोड का आउटपुट क्या होगा? What will be the output of the following Python code? s = “Python” print(s[1:4]) (A) yth (B) Pyth (C) tho (D) ytho Correct Answer: (A) yth Explanation: स्ट्रिंग “Python” में इंडेक्स 1 (‘y’), इंडेक्स 2 (‘t’) और इंडेक्स 3 (‘h’) मिलकर s[1:4] स्लाइसिंग पर ‘yth’ आउटपुट देंगे। Q. 26. निम्नलिखित में से कौन से फ्लोचार्ट डिजाइन के मुख्य सिद्धांत (Core Principles of Flowchart Design) हैं? Which of the following are the core principles of flowchart design? A. मानकीकृत प्रतीकों (Standardized symbols) का उपयोग करना B. स्पष्ट Start और End बिंदुओं को परिभाषित करना C. प्रवाह की दिशा हमेशा केवल नीचे से ऊपर (Bottom-to-Top only) रखना D. क्रॉसिंग लाइनों और अनंत उलझी लूपिंग से बचना तथा साफ तार्किक प्रवाह रखना (A) A and C only (B) B and C only (C) A, B, and D only (D) C and D only Correct Answer: (C) A, B, and D only Explanation: फ्लोचार्ट में मानक चिह्नों का उपयोग (A), स्पष्ट Start/End (B) और साफ प्रवाह (D) मुख्य सिद्धांत हैं, जबकि प्रवाह ऊपर से नीचे (Top-to-Bottom) या बाएं से दाएं होता है, न कि केवल नीचे से ऊपर। Q. 27. Python मॉड्यूल्स के इम्पोर्ट व्यवहार के बारे में इनमें से कौन सा कथन गलत (Incorrect) है? Which of the following statements is INCORRECT regarding module importing in Python? (A) A module’s namespace is created when it is imported for the first time (B) Importing the same module a second time in the same program automatically re-executes all its code from scratch (C) Loaded modules are cached in the sys.modules dictionary (D) Specific functions can be imported using from module import func Correct Answer: (B) Importing the same module a second time in the same program automatically re-executes all its code from scratch Explanation: दक्षता बनाए रखने के लिए Python किसी मॉड्यूल को एक सेशन में केवल पहली बार इम्पोर्ट करने पर ही रन करता है; दोबारा import लिखने पर वह sys.modules कैश से रेफरेंस ले लेता है और कोड को फिर से रन नहीं करता। Q. 28. नीचे दो कथन दिए गए हैं: Given below are two statements: अभिकथन (A): Python में स्ट्रिंग्स इम्यूटेबल (Immutable) होती हैं। (Assertion A: Strings in Python are immutable.) कारण (R): एक बार स्ट्रिंग बन जाने के बाद इंडेक्स असाइनमेंट के जरिए उसके व्यक्तिगत कैरेक्टर्स को इन-प्लेस बदला नहीं जा सकता है। (Reason R: Once a string is created, its individual characters cannot be modified in-place.) (A) (A) is true, but (R) is false (B) (A) is false, but (R) is true (C) Both (A) and (R) are false (D) Both (A) and (R) are true and (R) is the correct explanation of (A) Correct Answer: (D) Both (A) and (R) are true and (R) is the correct explanation of (A) Explanation: दोनों कथन सत्य हैं और कारण (R) सही रूप से स्पष्ट करता है कि स्ट्रिंग के अक्षरों को बनने के बाद सीधे बदला न जा सकना ही उसके इम्यूटेबल होने का अर्थ है। Q. 29. 1-D डिस्क्रीट फास्ट फूरियर ट्रांसफॉर्म (Fast Fourier Transform – FFT) की गणना करने के लिए NumPy के किस फंक्शन का उपयोग किया जाता है? Which NumPy function is used to compute the one-dimensional discrete Fast Fourier Transform (FFT)? (A) np.fft.fft() (B) np.math.fourier() (C) np.array.fft() (D) np.random.fft() Correct Answer: (A) np.fft.fft() Explanation: NumPy के सब-मॉड्यूल numpy.fft के अंतर्गत आने वाले np.fft.fft() फंक्शन का उपयोग 1-D फास्ट फूरियर ट्रांसफॉर्म निकालने के लिए किया जाता है। Q. 30. Python में फंक्शन्स (Functions) के बारे में निम्नलिखित में से कौन सी बात सही नहीं है (अर्थात गलत है)? Which of the following statements is NOT true about functions in Python? (A) Functions cannot be passed as arguments to other functions (B) Functions are first-class objects in Python (C) A function can be assigned to a variable (D) A function can return another function Correct Answer: (A) Functions cannot be passed as arguments to other functions Explanation: Python में फंक्शन्स First-class objects होते हैं, इसलिए उन्हें किसी वेरिएबल में स्टोर भी किया जा सकता है और दूसरे फंक्शन में आर्गुमेंट के तौर पर पास भी किया जा सकता है; अतः विकल्प (A) गलत है। Q. 31. Python फाइल हैंडलिंग में seek() मेथड के बारे में निम्नलिखित में से कौन सी बातें सही हैं? Which of the following statements are correct regarding the seek() method in Python? 1. f.seek(0) फाइल पॉइंटर को फाइल की शुरुआत (Beginning) में सेट करता है। 2. f.seek(5) फाइल पॉइंटर को शुरुआत से 5वीं बाइट पोजिशन पर सेट करता है। 3. डिफ़ॉल्ट टेक्स्ट मोड में बिना बाइनरी मोड खोले किसी भी रैंडम पोजिशन से नेगेटिव ऑफसेट देना हमेशा मान्य है। 4. बाइनरी मोड में f.seek(0, 2) फाइल पॉइंटर को फाइल के अंत (End of file) में ले जाता है। (A) 2 and 3 only (B) 1 and 3 only (C) 1, 2, and 4 only (D) 3 and 4 only Correct Answer: (C) 1, 2, and 4 only Explanation: कथन 1, 2 और 4 बिल्कुल सही हैं; जबकि कथन 3 गलत है क्योंकि Python 3 में टेक्स्ट मोड में केवल शुरुआत से धनात्मक ऑफसेट की ही अनुमति होती है (नेगेटिव रिलेटिव सीक के लिए बाइनरी मोड ‘rb’ आवश्यक है)। Q. 32. निम्नलिखित में से Python किन प्रोग्रामिंग पैराडाइम्स (Programming Paradigms) को सपोर्ट करती है? Which programming paradigms does Python support? (A) Procedural, Object-Oriented, and Functional programming (B) Only Low-level Machine coding (C) Only HTML Markup styling (D) None of the above Correct Answer: (A) Procedural, Object-Oriented, and Functional programming Explanation: Python एक बहुमुखी भाषा है जो प्रोसीजरल (फंक्शन आधारित), ऑब्जेक्ट-ओरिएंटेड (क्लास व ऑब्जेक्ट आधारित) और फंक्शनल (lambda, map, filter) तीनों पैराडाइम्स को सपोर्ट करती है। Q. 33. Python का कौन सा बिल्ट-इन डेटा टाइप केवल यूनिक (अद्वितीय) और अनऑर्डर्ड (Unordered) एलिमेंट्स को स्टोर करता है? Which built-in data type in Python stores unique and unordered elements? (A) List (B) Set (C) Tuple (D) String Correct Answer: (B) Set Explanation: Python में Set एक ऐसा अनऑर्डर्ड कलेक्शन है जो अपने आप सभी डुप्लीकेट मानों को हटा देता है और केवल यूनिक एलिमेंट्स को ही स्टोर करता है। Q. 34. Python में किसी साधारण पूर्णांक लिटरल (Integer Literal, जैसे x = 45) का डिफ़ॉल्ट संख्या आधार (Default Base) क्या होता है? What is the default base of an integer literal in Python? (A) Decimal (Base 10) (B) Binary (Base 2) (C) Octal (Base 8) (D) Hexadecimal (Base 16) Correct Answer: (A) Decimal (Base 10) Explanation: जब तक किसी संख्या के आगे 0b (Binary), 0o (Octal) या 0x (Hexadecimal) प्रीफिक्स न लगाया जाए, तब तक Python में हर पूर्णांक का डिफ़ॉल्ट आधार Decimal (Base 10) होता है। Q. 35. Python फाइल एक्सेस मोड्स का उनके सही कार्य से मिलान कीजिए: Match the Python file access modes with their correct function: List-I (Mode) — List-II (Function) A. ‘r’ — 1. पुरानी फाइल को ओवरराइट करके नया डेटा लिखता है (Overwrites existing file for writing) B. ‘w’ — 2. फाइल के अंत में बिना पुराना डेटा मिटाए नया डेटा जोड़ता है (Appends data at the end of file) C. ‘a’ — 3. फाइल खोलने का डिफ़ॉल्ट रीड-ओनली मोड (Default mode for reading only) D. ‘r+’ — 4. मौजूदा फाइल को पढ़ने और लिखने दोनों के लिए खोलता है (Opens existing file for both reading and writing) (A) A-1, B-2, C-3, D-4 (B) A-3, B-1, C-2, D-4 (C) A-2, B-3, C-4, D-1 (D) A-4, B-2, C-1, D-3 Correct Answer: (B) A-3, B-1, C-2, D-4 Explanation: ‘r’ डिफ़ॉल्ट रीड मोड है (A-3), ‘w’ ओवरराइट करके राइट करता है (B-1), ‘a’ अंत में डेटा अपेंड करता है (C-2), और ‘r+’ रीडिंग व राइटिंग दोनों की सुविधा देता है (D-4)। Q. 36. कौन सा इम्पोर्ट स्टेटमेंट मॉड्यूल के नाम का उपयोग करके मॉड्यूल के सदस्यों (members) को एक्सेस करने की अनुमति देता है? Which import statement allows accessing module members using the module name? (A) from module import * (B) import module (C) import * from module (D) using module Correct Answer: (B) import module Explanation: Python में import module स्टेटमेंट का उपयोग करने पर हमें मॉड्यूल के किसी भी फंक्शन या वेरिएबल को module.member सिंटैक्स के साथ एक्सेस करना होता है । Q. 37. पाइथन में कौन सा डेटा टाइप अपरिवर्तनीयता (immutability) सुनिश्चित करता है और डिक्शनरी कीज़ (dictionary keys) के रूप में उपयोग किए जाने की अनुमति देता है? Which data type in Python ensures immutability and is allowed to be used as dictionary keys? (A) List (B) Set (C) Tuple (D) Dictionary Correct Answer: (C) Tuple Explanation: Tuple एक immutable (अपरिवर्तनीय) और hashable डेटा टाइप है, इसलिए इसे Python डिक्शनरी में Key के रूप में इस्तेमाल किया जा सकता है (New Ideas YT)। Q. 38. पाइथन में assert स्टेटमेंट के बारे में निम्नलिखित में से कौन से कथन सही हैं? Which of the following statements are correct about the assert statement in Python? 1. शर्त (condition) गलत होने पर यह AssertionError उत्पन्न करता है / It raises an AssertionError if the condition is false 2. इसका उपयोग break के बजाय अनंत लूप से बाहर निकलने के लिए किया जाता है / It is used to break out of infinite loops instead of break 3. यह एक वैकल्पिक त्रुटि संदेश (optional error message) ले सकता है / It can take an optional error message 4. जब पाइथन को -O ऑप्टिमाइजेशन फ्लैग के साथ चलाया जाता है तो इसे अनदेखा (ignore) कर दिया जाता है / It is ignored when Python is run with the -O optimization flag (A) 1 and 2 only (B) 2 and 3 only (C) 1, 3, and 4 only (D) All 1, 2, 3, and 4 Correct Answer: (C) 1, 3, and 4 only Explanation: assert का उपयोग डिबगिंग के लिए किया जाता है जो शर्त False होने पर वैकल्पिक संदेश के साथ AssertionError देता है और -O मोड में निष्क्रिय हो जाता है, लेकिन यह लूप तोड़ने का टूल नहीं है (New Ideas YT)। Q. 39. निम्नलिखित पाइथन कोड का आउटपुट क्या होगा? What will be the output of the following Python code? x = [1, [2, 3], 4] print(x[1][0] – x[0]) (A) 2 (B) 3 (C) 1 (D) 0 Correct Answer: (C) 1 Explanation: यहाँ नेस्टेड लिस्ट में x[1][0] का मान 2 है और x[0] का मान 1 है, इसलिए 2 – 1 करने पर आउटपुट 1 प्राप्त होगा (LUCKY TECH. COM)। Q. 40. एल्गोरिदम डिज़ाइन में, किसी संख्या के फैक्टोरियल (Factorial) की गणना करने के लिए किस पुनरावृत्ति संबंध (recurrence relation) का उपयोग किया जाता है? In algorithm design, which recurrence relation is used to compute the Factorial of a number? (A) fact(n) = n * fact(n – 1) (B) fact(n) = n + fact(n – 1) (C) fact(n) = fact(n – 1) + fact(n – 2) (D) fact(n) = n * fact(n + 1) Correct Answer: (A) fact(n) = n * fact(n – 1) Explanation: किसी संख्या n का फैक्टोरियल निकालने के लिए n को (n – 1) के फैक्टोरियल से गुणा किया जाता है, अर्थात fact(n) = n * fact(n – 1) (New Ideas YT)। Q. 41. निम्नलिखित पाइथन कोड का आउटपुट क्या होगा? What will be the output of the following Python code? def f(x, y=[]): y.append(x) return y print(f(1), f(2)) (A) [1] [2] (B) [1, 2] [1, 2] (C) [1] [1, 2] (D) Error Correct Answer: (B) [1, 2] [1, 2] Explanation: Python में डिफ़ॉल्ट म्यूटेबल आर्गुमेंट (y=[]) केवल एक बार इनिशियलाइज़ होता है; जब print(f(1), f(2)) चलता है, तो दोनों कॉल एक ही लिस्ट रेफरेंस लौटाते हैं जिसमें f(2) के बाद [1, 2] दोनों जुड़ चुके होते हैं (New Ideas YT)। Q. 42. पाइथन में यूजर से स्ट्रिंग (string) के रूप में इनपुट लेने के लिए किस फंक्शन का उपयोग किया जाता है? Which function is used to take input from the user as a string in Python? (A) scan() (B) get() (C) read() (D) input() Correct Answer: (D) input() Explanation: Python 3 में input() फंक्शन का उपयोग कीबोर्ड से यूजर इनपुट लेने के लिए किया जाता है और यह डिफ़ॉल्ट रूप से स्ट्रिंग (str) लौटाता है (New Ideas YT)। Q. 43. निम्नलिखित अभिकथन (A) और कारण (R) पर विचार करें: Consider the following Assertion (A) and Reason (R): अभिकथन (A): पाइथन में एक फंक्शन एक से अधिक मान (multiple values) लौटा सकता है। Assertion (A): A function in Python can return multiple values. कारण (R): पाइथन स्वचालित रूप से एकाधिक रिटर्न मानों को एक लिस्ट (List) में पैक करता है। Reason (R): Python automatically packs multiple return values into a List. (A) Both (A) and (R) are true and (R) is the correct explanation of (A) (B) Both (A) and (R) are true, but (R) is not the correct explanation of (A) (C) (A) is true, but (R) is false (D) (A) is false, but (R) is true Correct Answer: (C) (A) is true, but (R) is false Explanation: अभिकथन (A) सत्य है, लेकिन कारण (R) असत्य है क्योंकि Python एकाधिक रिटर्न मानों को डिफ़ॉल्ट रूप से एक Tuple में पैक करता है, न कि List में (New Ideas YT)। Q. 44. निम्नलिखित स्कोप कीवर्ड्स/फंक्शन्स का उनके सही वर्णन से मिलान करें: Match the following scope keywords/functions with their correct description: सूची-I / List-I: A. global B. nonlocal C. locals() D. globals() सूची-II / List-II: 1. एनक्लोजिंग फंक्शन स्कोप में वेरिएबल को संशोधित करता है / Modifies variable in enclosing function scope 2. वर्तमान फंक्शन के बाहर ग्लोबल स्कोप में वेरिएबल को संशोधित करता है / Modifies variable outside current function in global scope 3. वर्तमान लोकल सिंबल टेबल की डिक्शनरी लौटाता है / Returns dictionary of current local symbol table 4. ग्लोबल सिंबल टेबल की डिक्शनरी लौटाता है / Returns dictionary of global symbol table (A) A-2, B-1, C-3, D-4 (B) A-1, B-2, C-3, D-4 (C) A-2, B-1, C-4, D-3 (D) A-4, B-3, C-2, D-1 Correct Answer: (A) A-2, B-1, C-3, D-4 Explanation: global ग्लोबल वेरिएबल को बदलता है, nonlocal बाहरी नेस्टेड फंक्शन के वेरिएबल को बदलता है, जबकि locals() और globals() क्रमशः लोकल व ग्लोबल सिंबल टेबल डिक्शनरी लौटाते हैं (New Ideas YT)। Q. 45. NumPy में np.asarray() फंक्शन क्या करता है? What does the np.asarray() function do in NumPy? (A) Always creates a deep copy of the array (B) Converts input to an array without copying if possible (C) Deletes an existing array from memory (D) Converts a NumPy array into a Python string Correct Answer: (B) Converts input to an array without copying if possible Explanation: np.asarray() दिए गए इनपुट को NumPy ऐरे में बदलता है और यदि इनपुट पहले से ही समान dtype का ऐरे है, तो नई कॉपी नहीं बनाता (New Ideas YT)। Q. 46. टपल (Tuple) पर लीनियर सर्च (Linear Search) के संबंध में कौन सा कथन सत्य है? Which statement is true regarding Linear Search on a Tuple? (A) Linear search cannot be applied on a Tuple because it is immutable (B) Linear search requires the Tuple to be sorted first (C) Linear search works the same on both Lists and Tuples (D) Tuple must be converted to a Set before linear search Correct Answer: (C) Linear search works the same on both Lists and Tuples Explanation: लीनियर सर्च केवल अनुक्रमिक रूप से तत्वों को पढ़ता और तुलना करता है (उन्हें बदलता नहीं है), इसलिए यह List और Tuple दोनों पर समान रूप से काम करता है (New Ideas YT)। Q. 47. निम्नलिखित फ्लोचार्ट प्रतीकों (Flowchart symbols) का उनके उपयोग से मिलान करें: Match the following Flowchart symbols with their usage: सूची-I / List-I: 1. Oval (अंडाकार) 2. Rectangle (आयत) 3. Parallelogram (समांतर चतुर्भुज) 4. Diamond (हीरा/समचतुर्भुज) सूची-II / List-II: A. Input / Output (इनपुट / आउटपुट) B. Process / Calculation (प्रक्रिया / गणना) C. Start / End (प्रारंभ / अंत) D. Decision (निर्णय) (A) 1-A, 2-B, 3-C, 4-D (B) 1-C, 2-B, 3-A, 4-D (C) 1-C, 2-A, 3-B, 4-D (D) 1-D, 2-B, 3-A, 4-C Correct Answer: (B) 1-C, 2-B, 3-A, 4-D Explanation: फ्लोचार्ट में Oval का उपयोग Start/End, Rectangle का उपयोग Process, Parallelogram का उपयोग Input/Output और Diamond का उपयोग Decision के लिए होता है (New Ideas YT)। Q. 48. NumPy dtype के बारे में निम्नलिखित में से कौन सा कथन गलत (INCORRECT) है? Which of the following statements about NumPy dtype is INCORRECT? (A) It describes the data type of elements stored in a NumPy array (B) All elements in a standard NumPy ndarray share the same dtype (C) An array’s elements can never be converted to another type using methods like astype() (D) dtype can be explicitly specified while creating an array Correct Answer: (C) An array’s elements can never be converted to another type using methods like astype() Explanation: astype() मेथड का उपयोग करके हम किसी भी NumPy ऐरे के डेटा टाइप को दूसरे डेटा टाइप में आसानी से कास्ट (convert) कर सकते हैं, इसलिए कथन (C) गलत है (New Ideas YT)। Q. 49. एक छात्र निम्नलिखित कोड लिखता है; इसका आउटपुट क्या होगा? A student writes the following code; what will be its output? x = [10, 20] y = [10, 20] print(x == y, x is y) (A) True True (B) True False (C) False True (D) False False Correct Answer: (B) True False Explanation: x == y दोनों लिस्ट के मानों (values) की तुलना करता है जो समान हैं (True), जबकि x is y दोनों के मेमोरी एड्रेस की तुलना करता है जो अलग-अलग ऑब्जेक्ट होने के कारण False देता है (New Ideas YT)। Q. 50. जब कोई सबक्लास (subclass) अपनी पैरेंट/सुपर क्लास से किसी मेथड को फिर से परिभाषित (redefine) करता है, तो OOP का कौन सा सिद्धांत सबसे अच्छा प्रदर्शित होता है? Which principle of OOP is best demonstrated when a subclass redefines a method from its parent/super class? (A) Polymorphism (Method Overriding) (B) Encapsulation (C) Data Hiding (D) Instantiation Correct Answer: (A) Polymorphism (Method Overriding) Explanation: सबक्लास में पैरेंट क्लास के समान नाम वाले मेथड को पुनः परिभाषित करना मेथड ओवरराइडिंग (Method Overriding) कहलाता है, जो Polymorphism का उदाहरण है (New Ideas YT)। Q. 51. निम्नलिखित कथनों के लिए सही (True) या गलत (False) चिह्नित करें: Mark True or False for the following statements: 1. उच्च-स्तरीय प्रोग्रामिंग भाषाएँ बिना किसी अनुवाद के सीधे CPU द्वारा निष्पादित की जाती हैं / High-level programming languages are directly executed by the CPU without translation 2. एल्गोरिदम समस्या समाधान के लिए चरण-दर-चरण प्रक्रियाएं हैं / Algorithms are step-by-step procedures for problem-solving 3. कंपाइलर उच्च-स्तरीय कोड को मशीन कोड में अनुवादित करते हैं / Compilers translate high-level code into machine code 4. डिबगिंग त्रुटियों को खोजने और ठीक करने की प्रक्रिया है / Debugging is the process of finding and fixing errors (A) True, True, True, True (B) False, True, True, True (C) False, False, True, True (D) True, False, False, True Correct Answer: (B) False, True, True, True Explanation: CPU केवल मशीन भाषा (0 और 1) को सीधे समझता है इसलिए पहला कथन गलत (False) है, जबकि बाकी तीनों कथन सत्य (True) हैं (New Ideas YT)। Q. 52. निम्नलिखित में से कौन से एल्गोरिदम निर्णय-आधारित (decision-based / branching) प्रोसेसिंग के उदाहरण हैं? Which of the following algorithms are examples of decision-based (branching) processing? A. किसी ऐरे में सबसे बड़ी संख्या खोजना / Finding the largest number in an array B. निश्चित दर का उपयोग करके साधारण मुद्रा रूपांतरण / Simple currency conversion using a fixed rate C. यह परीक्षण करना कि कोई संख्या अभाज्य (prime) है या नहीं / Testing whether a number is prime D. दो वेरिएबल्स को आपस में बदलना (Swapping) / Swapping two variables (A) A and B only (B) B and D only (C) A and C only (D) A, B, and C only Correct Answer: (C) A and C only Explanation: सबसे बड़ी संख्या खोजने और अभाज्य संख्या की जाँच करने में तुलना (if-else निर्णय) की आवश्यकता होती है, जबकि मुद्रा रूपांतरण और स्वैपिंग सीधी अनुक्रमिक (sequential) प्रक्रियाएं हैं (New Ideas YT)। Q. 53. निम्नलिखित पाइथन स्ट्रिंग मेथड्स का उनके कार्य से मिलान करें: Match the following Python string methods with their function: सूची-I / List-I: A. find() B. replace() C. split() D. join() सूची-II / List-II: पुरानी सबस्ट्रिंग को नई सबस्ट्रिंग से बदलता है / Replaces old substring with new substring सबस्ट्रिंग का सबसे छोटा इंडेक्स खोजता है या न मिलने पर -1 लौटाता है / Finds lowest index of substring or returns -1 स्ट्रिंग को सबस्ट्रिंग्स की एक लिस्ट में विभाजित करता है / Splits string into a list of substrings इटरेबल तत्वों को जोड़कर एक स्ट्रिंग बनाता है / Joins iterable elements into a string (A) A-2, B-1, C-3, D-4 (B) A-1, B-2, C-3, D-4 (C) A-2, B-3, C-1, D-4 (D) A-4, B-1, C-3, D-2 Correct Answer: (A) A-2, B-1, C-3, D-4 Explanation: find() सबस्ट्रिंग का इंडेक्स देता है (न मिलने पर -1), replace() शब्द बदलता है, split() लिस्ट में तोड़ता है और join() तत्वों को जोड़ता है (New Ideas YT)। Q. 54. यदि arr = np.array([10, 20, 30, 40]) है, तो arr.shape क्या लौटाएगा? If arr = np.array([10, 20, 30, 40]), what will arr.shape return? (A) (1, 4) (B) (4, 1) (C) 4 (D) (4,) Correct Answer: (D) (4,) Explanation: 1-D NumPy ऐरे जिसमें 4 तत्व हैं, उसका shape एट्रिब्यूट एक सिंगल-एलिमेंट टपल (4,) लौटाता है (New Ideas YT)। Q. 55. कौन सी प्रथा प्रोग्राम की पठनीयता (readability) और भविष्य के रखरखाव (maintenance) में सुधार करती है? Which practice improves program readability and future maintenance? (A) Documentation and comments (B) Using single-letter variable names everywhere (C) Writing the entire program on a single line (D) Removing all spaces and indentation Correct Answer: (A) Documentation and comments Explanation: उचित डॉक्यूमेंटेशन (docstrings) और कमेंट्स लिखने से कोड को समझना और भविष्य में उसे अपडेट या मेंटेन करना आसान हो जाता है (New Ideas YT)। Q. 56. निम्नलिखित कथनों के लिए सही (True) या गलत (False) चिह्नित करें: Mark True or False for the following statements: 1. x // y हमेशा एक फ्लोट (float) मान लौटाता है / x // y always returns a float value 2. x ^ y पाइथन में एक घातांक (exponent) ऑपरेटर है / x ^ y is an exponent operator in Python 3. while लूप में else ब्लॉक तब चलता है जब लूप बिना break के सामान्य रूप से समाप्त होता है / The else block in a while loop runs when the loop finishes normally without break 4. continue स्टेटमेंट तुरंत पूरे लूप को समाप्त कर देता है / The continue statement immediately terminates the entire loop (A) True, False, True, False (B) False, True, False, True (C) False, False, False, False (D) False, False, True, False Correct Answer: (D) False, False, True, False Explanation: केवल कथन 3 सत्य है; // पूर्णांक भागफल देता है, ^ बिटवाइज़ XOR ऑपरेटर है (घातांक ** होता है), और continue केवल वर्तमान इटरेशन को स्किप करता है (New Ideas YT)। Q. 57. निम्नलिखित में से कौन से पाइथन स्ट्रिंग ऑपरेशंस मान्य (VALID) हैं? Which of the following Python string operations are VALID? 1. “Hi” + “There” 2. “Hi” – “i” 3. “Hi” * 3 4. “Hi”[1] (A) 1 and 2 only (B) 1, 3, and 4 only (C) 2, 3, and 4 only (D) All 1, 2, 3, and 4 Correct Answer: (B) 1, 3, and 4 only Explanation: स्ट्रिंग्स में जोड़ना (+), दोहराना (*) और इंडेक्सिंग ([1]) मान्य हैं, लेकिन स्ट्रिंग्स पर घटाव (-) ऑपरेटर समर्थित नहीं है और TypeError देता है (New Ideas YT)। Q. 58. निम्नलिखित अभिकथन (A) और कारण (R) पर विचार करें: Consider the following Assertion (A) and Reason (R): अभिकथन (A): पाइथन में, लिस्ट (Lists) परिवर्तनशील (mutable) हैं जबकि टपल (Tuples) अपरिवर्तनीय (immutable) हैं। Assertion (A): In Python, Lists are mutable while Tuples are immutable. कारण (R): टपल सन्निहित मेमोरी (contiguous memory) में संग्रहीत होते हैं जबकि लिस्ट डबली लिंक्ड लिस्ट (doubly linked lists) के रूप में संग्रहीत होती हैं। Reason (R): Tuples are stored in contiguous memory whereas Lists are stored as doubly linked lists. (A) Both (A) and (R) are true and (R) is the correct explanation of (A) (B) (A) is true, but (R) is false (C) (A) is false, but (R) is true (D) Both (A) and (R) are false Correct Answer: (B) (A) is true, but (R) is false Explanation: अभिकथन (A) सत्य है, परंतु कारण (R) गलत है क्योंकि CPython में List भी लिंक्ड लिस्ट के बजाय डायनामिक सन्निहित ऐरे (contiguous dynamic array of pointers) के रूप में संग्रहीत होती है (New Ideas YT)। Q. 59. किसी लिस्ट L की शैलो कॉपी (shallow copy) बनाने के लिए किस मेथड का उपयोग किया जाता है? Which method is used to create a shallow copy of a list L? (A) L.clone() (B) L.duplicate() (C) L.deepcopy() (D) L.copy() Correct Answer: (D) L.copy() Explanation: L.copy() मेथड लिस्ट L की एक नई शैलो कॉपी (shallow copy) बनाता है (New Ideas YT)। Q. 60. global और nonlocal कीवर्ड के बारे में कौन सा कथन गलत (INCORRECT) है? Which statement about global and nonlocal keywords is INCORRECT? (A) global binds a variable to the module-level global namespace (B) nonlocal is used inside nested functions to modify variables in the enclosing function scope (C) Using global inside a nested function always modifies the nearest enclosing function’s local scope (D) nonlocal cannot be used to reference global module-level variables Correct Answer: (C) Using global inside a nested function always modifies the nearest enclosing function’s local scope Explanation: नेस्टेड फंक्शन के अंदर global का उपयोग करने पर भी वह सीधे मॉड्यूल के टॉप-लेवल ग्लोबल वेरिएबल को संदर्भित करता है, न कि बाहरी फंक्शन के लोकल स्कोप को (उसके लिए nonlocal होता है) (New Ideas YT)। Q. 61. निम्नलिखित अभिकथन (A) और कारण (R) पर विचार करें: Consider the following Assertion (A) and Reason (R): अभिकथन (A): यदि दो मॉड्यूल एक ही नाम से किसी वेरिएबल या फंक्शन को परिभाषित करते हैं, तो दोनों मॉड्यूल को इम्पोर्ट करने (import mod1, mod2) से नाम का टकराव (name collision) नहीं होगा। Assertion (A): If two modules define a variable or function with the same name, importing both modules (import mod1, mod2) will not cause a name collision. कारण (R): प्रत्येक मॉड्यूल अपना अलग स्वतंत्र नेमस्पेस (isolated namespace) बनाए रखता है। Reason (R): Each module maintains its own separate isolated namespace. (A) Both (A) and (R) are true and (R) is the correct explanation of (A) (B) Both (A) and (R) are true, but (R) is not the correct explanation of (A) (C) (A) is true, but (R) is false (D) (A) is false, but (R) is true Correct Answer: (A) Both (A) and (R) are true and (R) is the correct explanation of (A) Explanation: प्रत्येक मॉड्यूल का अपना अलग नेमस्पेस होता है (mod1.func और mod2.func), इसलिए दोनों को import करने पर नामों का टकराव नहीं होता (New Ideas YT)। Q. 62. पाइथन के open() फंक्शन में डिफ़ॉल्ट फ़ाइल एक्सेस मोड क्या है? What is the default file access mode in Python’s open() function? (A) ‘w’ (B) ‘a’ (C) ‘rb’ (D) ‘r’ Correct Answer: (D) ‘r’ Explanation: यदि open() फंक्शन में कोई मोड निर्दिष्ट नहीं किया जाता है, तो यह डिफ़ॉल्ट रूप से टेक्स्ट रीड मोड (‘r’) में फ़ाइल खोलता है (New Ideas YT)। Q. 63. निम्नलिखित पाइथन कोड का आउटपुट क्या होगा? What will be the output of the following Python code? s1 = {1, 2, 3} s2 = {2, 3, 4} print(s1 ^ s2) (A) {1} (B) {2, 3} (C) {1, 4} (D) {1, 2, 3, 4} Correct Answer: (C) {1, 4} Explanation: सेट में ^ ऑपरेटर सिमेट्रिक डिफरेंस (Symmetric Difference) निकालता है, जो उन तत्वों को लौटाता है जो दोनों सेटों में कॉमन नहीं हैं ({1, 4}) (New Ideas YT)। Q. 64. यूक्लिड के एल्गोरिदम (Euclid’s algorithm) का उपयोग करके 48 और 18 का GCD (महत्तम समापवर्तक) ज्ञात करने के लिए कितने पुनरावृत्त मॉड्यूलो चरणों (iterative modulo steps) की आवश्यकता होती है? How many iterative modulo steps are required to find the GCD of 48 and 18 using Euclid’s algorithm? (A) 1 (B) 2 (C) 4 (D) 3 Correct Answer: (D) 3 Explanation: यूक्लिड एल्गोरिदम में 3 मॉड्यूलो चरण लगते हैं: पहला 48 % 18 = 12, दूसरा 18 % 12 = 6, और तीसरा 12 % 6 = 0 (जहाँ शेषफल 0 होने पर GCD 6 मिलता है) (New Ideas YT)। Q. 65. निम्नलिखित अभिकथन (A) और कारण (R) पर विचार करें: Consider the following Assertion (A) and Reason (R): अभिकथन (A): पाइथन को एक इंटरप्रेटेड भाषा (interpreted language) माना जाता है। Assertion (A): Python is considered an interpreted language. कारण (R): पाइथन सोर्स कोड को पहले बाइटकोड में संकलित किया जाता है और फिर पाइथन वर्चुअल मशीन (PVM) द्वारा निष्पादित किया जाता है। Reason (R): Python source code is first compiled into bytecode and then executed by the Python Virtual Machine (PVM). (A) (A) is true, but (R) is false (B) (A) is false, but (R) is true (C) Both (A) and (R) are false (D) Both (A) and (R) are true and (R) is the correct explanation of (A) Correct Answer: (D) Both (A) and (R) are true and (R) is the correct explanation of (A) Explanation: Python सोर्स कोड आंतरिक रूप से बाइटकोड (.pyc) में बदलता है जिसे PVM (इंटरप्रेटर इंजन) लाइन-दर-लाइन निष्पादित करता है, इसीलिए इसे इंटरप्रेटेड भाषा कहा जाता है (New Ideas YT)। Q. 66. निम्नलिखित पाइथन कोड का आउटपुट क्या होगा? What will be the output of the following Python code? for i in range(1, 4): if i == 2: break print(i) (A) 1 2 (B) 1 (C) 1 2 3 (D) 2 Correct Answer: (B) 1 Explanation: लूप 1 से शुरू होकर पहले 1 प्रिंट करेगा; अगली बार जब i का मान 2 होगा तो break स्टेटमेंट लूप को तुरंत समाप्त कर देगा (New Ideas YT)। Q. 67. निम्नलिखित NumPy ऐरे निर्माण फंक्शन्स का उनके कार्य से मिलान करें: Match the following NumPy array creation functions with their task: सूची-I / List-I: A. np.zeros() B. np.ones() C. np.arange() D. np.linspace() सूची-II / List-II: 1. एक रेंज में दिए गए स्टेप साइज़ (step size) के साथ ऐरे बनाता है / Creates array with step size in a range 2. 1 से भरा हुआ ऐरे बनाता है / Creates array filled with 1s 3. 0 से भरा हुआ ऐरे बनाता है / Creates array filled with 0s 4. समान दूरी वाले बिंदुओं (evenly spaced points) के साथ ऐरे बनाता है / Creates array with evenly spaced points (A) A-3, B-2, C-1, D-4 (B) A-2, B-3, C-1, D-4 (C) A-3, B-2, C-4, D-1 (D) A-1, B-2, C-3, D-4 Correct Answer: (A) A-3, B-2, C-1, D-4 Explanation: zeros() शून्य से, ones() एक से, arange() स्टेप वैल्यू से और linspace() समान अंतराल वाले बिंदुओं की संख्या के आधार पर ऐरे बनाता है (New Ideas YT)। Q. 68. फ़ाइल हैंडलिंग में write() और writelines() के संबंध में कौन सा कथन सत्य है? Which statement is true regarding write() and writelines() in file handling? (A) writelines() automatically adds a newline character after each string (B) write() can directly take a list of strings as an argument (C) writelines() writes a list of strings to the file without automatically adding newline characters (D) Both functions work only on binary files Correct Answer: (C) writelines() writes a list of strings to the file without automatically adding newline characters Explanation: writelines() स्ट्रिंग्स की एक लिस्ट या अनुक्रम को फ़ाइल में लिखता है, लेकिन यह अपने आप नई लाइन (\n) नहीं जोड़ता है (New Ideas YT)। Q. 69. निम्नलिखित कथनों के लिए सही (True) या गलत (False) चिह्नित करें: Mark True or False for the following statements: 1. एक एल्गोरिदम हमेशा पाइथन जैसी किसी विशिष्ट प्रोग्रामिंग भाषा में ही लिखा जाना चाहिए / An algorithm must always be written in a specific programming language like Python 2. संकलन (Compilation) उच्च-स्तरीय कोड को मशीन कोड में परिवर्तित करता है / Compilation converts high-level code into machine code 3. परीक्षण (Testing) शुद्धता की पुष्टि करता है जबकि डिबगिंग त्रुटियों को ठीक करता है / Testing verifies correctness while debugging fixes errors 4. डॉक्यूमेंटेशन कोड रखरखाव में सुधार करता है / Documentation improves code maintenance (A) False, True, True, True (B) True, True, True, True (C) False, False, True, True (D) True, False, True, False Correct Answer: (A) False, True, True, True Explanation: एल्गोरिदम किसी भी प्रोग्रामिंग भाषा से स्वतंत्र होता है और इसे सामान्य भाषा या स्यूडोकोड में लिखा जा सकता है, इसलिए पहला कथन गलत (False) है और बाकी तीनों सही (True) हैं (New Ideas YT)। Q. 70. आकार n की एक अवर्गीकृत (unsorted) लिस्ट में लीनियर सर्च की सबसे खराब स्थिति (worst-case) की समय जटिलता (time complexity) क्या है? What is the worst-case time complexity of linear search in an unsorted list of size n? (A) O(n) (B) O(log n) (C) O(1) (D) O(n^2) Correct Answer: (A) O(n) Explanation: लीनियर सर्च में सबसे खराब स्थिति में (जब तत्व अंत में हो या मौजूद न हो) पूरे n तत्वों की जाँच करनी पड़ती है, इसलिए इसकी समय जटिलता O(n) होती है (New Ideas YT)। यहाँ M3-R5 (Python – 12 July 2026) Original Exam Paper Set-1 का Part 3 (Q. 71 से Q. 100) आपके मूल साफ-सुथरे फॉर्मेट में प्रस्तुत है: Q. 71. किसी फंक्शन को कॉल करते समय उसे पास किए जाने वाले आर्गुमेंट्स को क्या कहा जाता है? Arguments passed to a function at the time of calling the function are called: (A) Actual arguments (B) Formal arguments (C) Default arguments (D) Optional arguments Correct Answer: (A) Actual arguments Explanation: फंक्शन कॉल करते समय जो मान (values) या वेरिएबल भेजे जाते हैं उन्हें Actual arguments (वास्तविक आर्गुमेंट्स) कहा जाता है, जबकि फंक्शन डेफिनिशन में लिखे पैरामीटर्स को Formal arguments कहते हैं। Q. 72. निम्नलिखित में से कौन सा विकल्प कम्प्यूटेशन के मूल मॉडल (fundamental model of computation) को सही ढंग से परिभाषित करता है? Which of the following options correctly defines the fundamental model of computation? (A) Input -> Algorithm / Process -> Output (B) Output -> Process -> Input (C) Algorithm -> Input -> Output (D) Process -> Output -> Input Correct Answer: (A) Input -> Algorithm / Process -> Output Explanation: किसी भी कम्प्यूटेशन मॉडल का मूल क्रम सबसे पहले डेटा इनपुट लेना, फिर एल्गोरिदम के अनुसार उसे प्रोसेस करना और अंत में आउटपुट प्रदान करना होता है। Q. 73. पाइथन के math मॉड्यूल में कौन सा फंक्शन कोण x को रेडियन (radians) से डिग्री (degrees) में बदलता है? Which function in Python’s math module converts angle x from radians to degrees? (A) math.rad2deg(x) (B) math.degrees(x) (C) math.to_degrees(x) (D) math.deg(x) Correct Answer: (B) math.degrees(x) Explanation: पाइथन के math मॉड्यूल में math.degrees(x) फंक्शन का उपयोग कोण को रेडियन से डिग्री में परिवर्तित करने के लिए किया जाता है। Q. 74. यदि arr = np.linspace(0, 1, 5) है, तो arr[2] का मान क्या होगा? If arr = np.linspace(0, 1, 5), what will be the value of arr[2]? (A) 0.25 (B) 0.5 (C) 0.75 (D) 1.0 Correct Answer: (B) 0.5 Explanation: np.linspace(0, 1, 5) द्वारा 0 से 1 के बीच 5 समान दूरी वाले तत्व [0., 0.25, 0.5, 0.75, 1.] बनते हैं, जिसमें इंडेक्स 2 पर 0.5 होता है। Q. 75. निम्नलिखित पाइथन कोड का आउटपुट क्या होगा? What will be the output of the following Python code? x = [10, 20, 30] s = 0 for i in range(len(x)): if i % 2 == 0: s = s + x[i] else: s = s – x[i] print(s) (A) 60 (B) 20 (C) 20 (D) 40 Correct Answer: (B) 20 Explanation: इंडेक्स 0 और 2 (सम इंडेक्स) के मान 10 और 30 जुड़ेंगे (10 + 30 = 40) तथा इंडेक्स 1 का मान 20 घटेगा (40 – 20 = 20), इसलिए आउटपुट 20 होगा। Q. 76. निम्नलिखित NumPy ऐरे एट्रिब्यूट्स का उनके सही वर्णन से मिलान करें: Match the following NumPy array attributes with their correct description: A. ndim B. shape C. size D. dtype 1. तत्वों की कुल संख्या (Total number of elements) 2. आयामों या अक्षों की संख्या (Number of dimensions/axes) 3. ऐरे के आयामों का टपल (Tuple of array dimensions) 4. तत्वों का डेटा प्रकार (Data type of elements) (A) A-1, B-2, C-3, D-4 (B) A-2, B-1, C-3, D-4 (C) A-3, B-2, C-1, D-4 (D) A-2, B-3, C-1, D-4 Correct Answer: (D) A-2, B-3, C-1, D-4 Explanation: NumPy में ndim आयामों की संख्या, shape प्रत्येक आयाम का आकार (टपल में), size कुल तत्वों की संख्या और dtype डेटा का प्रकार बताता है। Q. 77. निम्नलिखित में से कौन सी समस्या पाइथन में रिकर्शन (Recursion) का उपयोग करके हल नहीं की जा सकती है? Which of the following problems CANNOT be solved using Recursion in Python? (A) Fibonacci series (B) Factorial of a number (C) None of the above (D) Tower of Hanoi Correct Answer: (C) None of the above Explanation: फिबोनाची सीरीज, फैक्टोरियल और टॉवर ऑफ हनोई तीनों ही रिकर्शन के प्रमुख उदाहरण हैं और इन्हें रिकर्शन से आसानी से हल किया जा सकता है। Q. 78. निम्नलिखित कथनों के लिए सही (True) या गलत (False) चिह्नित करें: Mark True or False for the following statements: 1. यदि L2 = L1 और L1[0] = 99 किया जाए, तो L2[0] भी 99 हो जाता है / If L2 = L1 and L1[0] = 99, L2[0] also becomes 99 2. टपल भी लिस्ट की तरह इंडेक्सिंग और स्लाइसिंग का समर्थन करते हैं / Tuples support indexing and slicing like lists 3. डिक्शनरी कीज़ (keys) हमेशा अद्वितीय (unique) होती हैं / Dictionary keys are always unique 4. “Hello”[1:4] का मान “ell” होता है / “Hello”[1:4] evaluates to “ell” (A) True, False, True, True (B) False, True, True, True (C) True, True, False, True (D) True, True, True, True Correct Answer: (D) True, True, True, True Explanation: दिए गए चारों कथन पूर्णतः सत्य हैं क्योंकि लिस्ट असाइनमेंट रेफरेंस साझा करता है, टपल में स्लाइसिंग होती है, डिक्शनरी कीज़ डुप्लीकेट नहीं हो सकतीं और इंडेक्स 1 से 3 तक “ell” मिलता है। Q. 79. पाइथन में स्ट्रिंग मेथड्स के बारे में निम्नलिखित में से कौन सा कथन गलत (INCORRECT) है? Which of the following statements about string methods in Python is INCORRECT? (A) s.lower() returns a new string in lowercase (B) s.upper() modifies the original string in-place (C) s.strip() removes leading and trailing whitespaces (D) s.isalpha() returns True if all characters are alphabetic Correct Answer: (B) s.upper() modifies the original string in-place Explanation: पाइथन में स्ट्रिंग्स अपरिवर्तनीय (immutable) होती हैं, इसलिए s.upper() मूल स्ट्रिंग में बदलाव करने के बजाय बड़े अक्षरों में एक नई स्ट्रिंग लौटाता है। Q. 80. रिकर्सिव बाइनरी सर्च (Recursive Binary Search) की समय जटिलता (Time Complexity) क्या होती है? What is the time complexity of Recursive Binary Search? (A) O(n) (B) O(n log n) (C) O(n^2) (D) O(log n) Correct Answer: (D) O(log n) Explanation: बाइनरी सर्च प्रत्येक चरण में सर्च स्पेस को आधा कर देता है, इसलिए इसकी समय जटिलता O(log n) होती है। Q. 81. file.seek(offset, whence) फंक्शन में, whence = 1 (जैसे file.seek(0, 1)) क्या दर्शाता है? In the file.seek(offset, whence) function, what does whence = 1 (e.g., file.seek(0, 1)) signify? (A) Beginning of the file (B) End of the file (C) Middle of the file (D) Current file pointer position Correct Answer: (D) Current file pointer position Explanation: seek() मेथड में whence का मान 0 होने पर फाइल के प्रारंभ से, 1 होने पर वर्तमान पोजीशन (current position) से और 2 होने पर फाइल के अंत से ऑफसेट गिना जाता है। Q. 82. दिए गए 2D ऐरे में arr[1, :2] का आउटपुट क्या होगा? Given the 2D array below, what will be the output of arr[1, :2]? import numpy as np arr = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) print(arr[1, :2]) (A) [1, 2] (B) [4, 5] (C) [4, 5, 6] (D) [2, 5] Correct Answer: (B) [4, 5] Explanation: यहाँ arr[1, :2] दूसरी पंक्ति (इंडेक्स 1 यानी [4, 5, 6]) के पहले दो कॉलम (इंडेक्स 0 और 1) को स्लाइस करता है, जिससे [4, 5] प्राप्त होता है। Q. 83. निम्नलिखित अभिकथन (A) और कारण (R) पर विचार करें: Consider the following Assertion (A) and Reason (R): अभिकथन (A): readline() मेथड संपूर्ण फ़ाइल सामग्री को लाइनों की एक लिस्ट में पढ़ता है। Assertion (A): The readline() method reads the entire file content into a list of lines. कारण (R): readline() एक समय में फ़ाइल से केवल एक ही लाइन पढ़ता है। Reason (R): readline() reads only one single line from the file at a time. (A) Both (A) and (R) are true and (R) is the correct explanation of (A) (B) Both (A) and (R) are true, but (R) is not the correct explanation of (A) (C) (A) is true, but (R) is false (D) (A) is false, but (R) is true Correct Answer: (D) (A) is false, but (R) is true Explanation: संपूर्ण फाइल को लिस्ट के रूप में पढ़ने का काम readlines() करता है, जबकि readline() एक बार में केवल एक सिंगल लाइन पढ़ता है; अतः (A) गलत और (R) सही है। Q. 84. पाइथन में कौन सा मॉड्यूल pi और e जैसे गणितीय स्थिरांक (mathematical constants) प्रदान करता है? Which module in Python provides access to mathematical constants like pi and e? (A) random (B) sys (C) statistics (D) math Correct Answer: (D) math Explanation: पाइथन का बिल्ट-इन math मॉड्यूल math.pi और math.e जैसे मानक गणितीय स्थिरांक और त्रिकोणमितीय फंक्शन प्रदान करता है। Q. 85. निम्नलिखित पाइथन कोड का आउटपुट क्या होगा? What will be the output of the following Python code? def add_item(val, lst=[]): lst.append(val) return lst print(add_item(1)) print(add_item(2)) (A) [1] और [2] (B) [1] और [1, 2] (C) [1, 2] और [1, 2] (D) Error Correct Answer: (B) [1] और [1, 2] Explanation: अलग-अलग print स्टेटमेंट होने के कारण पहली कॉल में लिस्ट में 1 जुड़कर [1] प्रिंट होता है, और दूसरी कॉल में उसी डिफ़ॉल्ट लिस्ट में 2 जुड़ने से [1, 2] प्रिंट होता है। Q. 86. किसी पूर्णांक संख्या के अंकों को उलटने (जैसे 123 को 321 करने) के लिए किस एल्गोरिदम पद्धति का उपयोग किया जाता है? Which algorithmic approach is used to reverse the digits of an integer number (e.g., 123 to 321)? (A) Multiplication and Addition only (B) Divide and Modulo approach (% 10 and // 10) (C) Bitwise shifting approach (D) Linear Search approach Correct Answer: (B) Divide and Modulo approach (% 10 and // 10) Explanation: किसी संख्या का अंतिम अंक निकालने के लिए % 10 (मॉड्यूलो) और अंतिम अंक हटाने के लिए // 10 (पूर्णांक भाग) का लूप में उपयोग किया जाता है। Q. 87. कौन सी लोकप्रिय पाइथन लाइब्रेरी मशीन लर्निंग और डीप लर्निंग के लिए API प्रदान करती है? Which popular Python library provides APIs for Machine Learning and Deep Learning? (A) TensorFlow (B) Tkinter (C) Pygame (D) Requests Correct Answer: (A) TensorFlow Explanation: TensorFlow गूगल द्वारा विकसित एक प्रमुख ओपन-सोर्स पाइथन लाइब्रेरी है जिसका उपयोग मशीन लर्निंग और डीप न्यूरल नेटवर्क बनाने में किया जाता है। Q. 88. math मॉड्यूल से केवल sqrt फंक्शन को इम्पोर्ट करने के लिए कौन सा स्टेटमेंट सही है? Which statement is correct to import only the sqrt function from the math module? (A) from math import sqrt (B) import sqrt from math (C) math import sqrt (D) include math.sqrt Correct Answer: (A) from math import sqrt Explanation: किसी मॉड्यूल से केवल एक विशिष्ट फंक्शन को सीधे वर्तमान नेमस्पेस में लाने के लिए from module_name import function_name सिंटैक्स का उपयोग होता है। Q. 89. पाइथन OOP में super() फंक्शन का उद्देश्य क्या है? What is the purpose of the super() function in Python OOP? (A) To call methods and constructors of the parent (super) class (B) To delete an object from memory (C) To create a new global variable (D) To terminate program execution Correct Answer: (A) To call methods and constructors of the parent (super) class Explanation: super() फंक्शन का उपयोग चाइल्ड क्लास के अंदर से पैरेंट (बेस) क्लास के कंस्ट्रक्टर या मेथड्स को कॉल करने के लिए किया जाता है। Q. 90. प्रोग्रामिंग भाषाओं की पीढ़ियों (Generations of Programming Languages) का उनके सही विवरण से मिलान करें: Match the Generations of Programming Languages with their correct description: 1. 1GL (First Generation) 2. 2GL (Second Generation) 3. 3GL (Third Generation) 4. 4GL (Fourth Generation) A. निमोनिक्स का उपयोग करने वाली असेंबली भाषा (Assembly language using mnemonics) B. उच्च-स्तरीय प्रक्रियात्मक/OOP भाषाएँ जैसे C, Python (High-level languages like C, Python) C. मशीन-स्तरीय बाइनरी निर्देश (Machine-level binary instructions) D. गैर-प्रक्रियात्मक डेटाबेस/क्वेरी भाषाएँ जैसे SQL (Non-procedural query languages like SQL) (A) 1-A, 2-B, 3-C, 4-D (B) 1-C, 2-B, 3-A, 4-D (C) 1-B, 2-A, 3-C, 4-D (D) 1-C, 2-A, 3-B, 4-D Correct Answer: (D) 1-C, 2-A, 3-B, 4-D Explanation: पहली पीढ़ी (1GL) मशीन बाइनरी भाषा है, दूसरी पीढ़ी (2GL) असेंबली भाषा है, तीसरी पीढ़ी (3GL) C/Java/Python जैसी उच्च-स्तरीय भाषाएँ हैं और चौथी पीढ़ी (4GL) SQL जैसी डोमेन-विशिष्ट भाषाएँ हैं। Q. 91. निम्नलिखित में से कौन सी स्ट्रिंग .isupper() मेथड के लिए False लौटाएगी? Which of the following strings will return False for the .isupper() method? (A) “HELLO” (B) “HELLO123” (C) “Hello” (D) “HELLO WORLD” Correct Answer: (C) “Hello” Explanation: “Hello” में ‘e’, ‘l’, ‘l’, ‘o’ छोटे अक्षर (lowercase) में हैं, इसलिए isupper() मेथड इसके लिए False लौटाएगा जबकि बाकी तीनों में सभी अक्षर कैपिटल हैं। Q. 92. दिए गए फंक्शन def add(x, y=10): return x + y के लिए निम्नलिखित में से कौन से फंक्शन कॉल मान्य (valid) हैं? Given the function def add(x, y=10): return x + y, which of the following function calls are valid? 1. add(5) 2. add(5, 20) 3. add(x=5, y=20) 4. add(y=20, x=5) (A) 1 and 2 only (B) 1, 2, and 3 only (C) 2 and 3 only (D) All 1, 2, 3, and 4 Correct Answer: (D) All 1, 2, 3, and 4 Explanation: पाइथन में डिफ़ॉल्ट आर्गुमेंट (add(5)), पोजीशनल आर्गुमेंट (add(5, 20)) और किसी भी क्रम में कीवर्ड आर्गुमेंट्स (add(x=5, y=20) तथा add(y=20, x=5)) चारों पूरी तरह मान्य हैं। Q. 93. प्रतीकात्मक गणित (Symbolic Mathematics / Computer Algebra) के लिए विशेष रूप से किस पाइथन लाइब्रेरी का उपयोग किया जाता है? Which Python library is specifically used for Symbolic Mathematics (computer algebra)? (A) Matplotlib (B) Pandas (C) SymPy (D) Seaborn Correct Answer: (C) SymPy Explanation: SymPy प्रतीकात्मक गणित (Symbolic Mathematics) के लिए बनाई गई पाइथन लाइब्रेरी है, जिसका उपयोग बीजगणितीय समीकरणों को सटीक प्रतीक रूप में हल करने के लिए किया जाता है। Q. 94. निम्नलिखित पाइथन फ़ाइल हैंडलिंग कोड का आउटपुट क्या होगा? What will be the output of the following Python file handling code? f = open(“t.txt”, “w+”) f.write(“ABCDE”) f.seek(2) print(f.read()) f.close() (A) AB (B) CDE (C) BCDE (D) ABCDE Correct Answer: (B) CDE Explanation: फाइल में “ABCDE” लिखने के बाद f.seek(2) फाइल पॉइंटर को इंडेक्स 2 (‘C’) पर ले जाता है, जहाँ से f.read() शेष अक्षर “CDE” को पढ़कर प्रिंट कर देता है। Q. 95. एक संपूर्ण उच्च-स्तरीय प्रोग्राम को एक ही बार में मशीन-पठनीय कोड में अनुवाद करने की प्रक्रिया को क्या कहा जाता है? The process of translating an entire high-level program into machine-readable code at once is called: (A) Interpretation (B) Compilation (C) Debugging (D) Execution Correct Answer: (B) Compilation Explanation: कंपाइलर पूरे सोर्स प्रोग्राम को एक साथ पढ़कर उसे मशीन कोड (ऑब्जेक्ट कोड) में बदलता है, और इस प्रक्रिया को संकलन (Compilation) कहते हैं। Q. 96. कौन से NumPy ऐरे निर्माण फंक्शन्स ‘स्टेप साइज़’ (step size) के बजाय ‘बिंदुओं/सैंपल्स की संख्या’ (number of points/samples) पर निर्भर करते हैं? Which NumPy array creation functions depend on the ‘number of points/samples’ rather than ‘step size’? 1. arange 2. linspace 3. logspace 4. zeros (A) 1 and 2 only (B) 2 and 3 only (C) 1, 2, and 3 only (D) 3 and 4 only Correct Answer: (B) 2 and 3 only Explanation: NumPy में linspace और logspace दोनों एक दी गई रेंज के भीतर जनरेट किए जाने वाले कुल बिंदुओं (samples) की संख्या लेते हैं, जबकि arange स्टेप साइज़ का उपयोग करता है। Q. 97. पाइथन में sys.modules डिक्शनरी का मुख्य उद्देश्य क्या है? What is the main purpose of the sys.modules dictionary in Python? (A) It lists all uninstalled third-party packages on the internet (B) It caches and maps module names to modules that have already been loaded (C) It deletes unused variables from local scope (D) It stores command-line arguments passed by the user Correct Answer: (B) It caches and maps module names to modules that have already been loaded Explanation: sys.modules एक ग्लोबल डिक्शनरी है जो वर्तमान सेशन में पहले से इम्पोर्ट किए जा चुके सभी मॉड्यूल्स का कैश (रिकॉर्ड) रखती है ताकि उन्हें बार-बार रीलोड न करना पड़े। Q. 98. किसी एल्गोरिदम या प्रोग्राम को कंप्यूटर पर वास्तव में चलाए बिना कागज पर मैन्युअल रूप से उसके प्रत्येक चरण को ट्रेस करने की प्रक्रिया को क्या कहा जाता है? The process of manually tracing each step of an algorithm or program on paper without actually executing it on a computer is called: (A) Compilation (B) Dry Run (C) Unit Testing (D) Profiling Correct Answer: (B) Dry Run Explanation: प्रोग्राम को कंप्यूटर पर रन करने से पहले उसके लॉजिक और वेरिएबल्स के मानों की कागज पर स्टेप-बाय-स्टेप जाँच करने को ड्राई रन (Dry Run) कहा जाता है। Q. 99. यदि d = {‘a’: 1, ‘b’: 2} है, तो d.get(‘c’, 5) क्या लौटाएगा? If d = {‘a’: 1, ‘b’: 2}, what will d.get(‘c’, 5) return? (A) 5 (B) None (C) KeyError (D) 2 Correct Answer: (A) 5 Explanation: डिक्शनरी का get(key, default) मेथड दी गई key (‘c’) के मौजूद न होने पर कोई एरर देने के बजाय दूसरा आर्गुमेंट यानी डिफ़ॉल्ट मान 5 लौटाता है। Q. 100. पाइथन में sys.argv के माध्यम से प्राप्त कमांड-लाइन आर्गुमेंट्स के बारे में कौन सा कथन सत्य है? Which statement is true about command-line arguments accessed via sys.argv in Python? (A) They are stored as a tuple of integers (B) They are stored as a dictionary of key-value pairs (C) They are always stored as a list of strings (str) (D) The first element sys.argv[0] is always the last argument passed Correct Answer: (C) They are always stored as a list of strings (str) Explanation: sys.argv कमांड-लाइन से पास किए गए सभी आर्गुमेंट्स को हमेशा स्ट्रिंग्स की एक लिस्ट (list of strings) के रूप में संग्रहीत करता है, जहाँ sys.argv[0] स्क्रिप्ट का नाम होता है। Leave a Comment Cancel ReplyYour email address will not be published. Required fields are marked *Type here.. Name* Email* Website Save my name, email, and website in this browser for the next time I comment. Notify me of follow-up comments by email. Notify me of new posts by email. ΔThis site uses Akismet to reduce spam. Learn how your comment data is processed.