O Level M3-R5 July 2026 Real Question Paper [100% Solved]

Python (M3-R5) ke paper mein List slicing, Dictionary methods, Recursion, aur NumPy arrays se aise output-based sawal puche jaate hain jahan ek choti si syntax detail miss hone par pura answer galat ho sakta hai. Aapki isi zarurat ko dhyan mein rakhte hue humne yahan O Level M3-R5 July 2026 Previous Year Question Paper with Answers ko Hindi aur English dono bhashaon mein pura solve karke diya hai. Is post mein aapko July 2026 session ke Programming and Problem Solving through Python original old question paper ke sabhi 100 MCQs aur unke 100% verified answers ek hi jagah par milenge, jisse aap har code snippet ke piche ka logic aasani se samajh sakenge. Niche diye gaye paper sets ko abhi step-by-step padhein, aur agar aap isi previous paper ki live practice ya offline copy chahte hain, toh isi page par diye gaye Online Test aur PDF Download links ka use karein.

All Previous Papers Page Link- Previous Papers of O Level

M3-R5 July 2026 O Level Previous Paper Question Answers

July 2026 Theory (MCQ) Analysis — Module 3: M3-R5 (Programming and Problem Solving through Python)

(12 जुलाई 2026 के ओरिजिनल 100 MCQs के विश्लेषण पर आधारित — मल्टी-स्टेटमेंट प्रश्न, कोड आउटपुट और एल्गोरिदम कॉम्प्लेक्सिटी का नया ट्रेंड)

Syllabus Unit / Topic (सिलेबस टॉपिक)पूछे गए प्रश्न (100 में से)July 2026 पेपर में पूछे गए वास्तविक टॉपिक्स (Actual Topics Asked)Priority Level (महत्व)
1. Data Types, Strings, Lists, Tuples, Sets & Dictionary (Unit 4)26 प्रश्न (26%)Strings (9 प्रश्न): Slicing (“Python”[1:4], “hello”[1:4]), इम्यूटेबिलिटी (A&R), upper(), isupper(), strip(), isdigit(), find(), स्ट्रिंग पर अमान्य ऑपरेशन (-)। Lists & Tuples (9 प्रश्न): म्यूटेबल बनाम इम्यूटेबल व मेमोरी (A&R), List रेफरेंसिंग (b=a; b.append), Shallow copy (list.copy()), Tuple को डिक्शनरी की (Key) बनाना, Linear Search। Set & Dict (6 प्रश्न): Set यूनिक/अनऑर्डर्ड, सिमेट्रिक डिफरेंस (^), d.get(‘c’, 5) आउटपुट, None कांस्टेंटHighest Priority (अति महत्वपूर्ण)
2. Functions, Recursion, LEGB Scope & Modules (Units 5, 6)24 प्रश्न (24%)Scope & Arguments (10 प्रश्न): LEGB रूल (Local, Enclosing, Global, Built-in — 2 प्रश्न), global बनाम nonlocal बनाम locals()/globals() मिलान, Default mutable argument आउटपुट, Actual arguments, फंक्शन से मल्टीपल रिटर्न (Tuple में पैक होना)। Recursion (5 प्रश्न): Recursion बनाम Iteration मेमोरी/स्टैक (2 प्रश्न), डिफ़ॉल्ट रिकर्शन लिमिट (1000) व sys.setrecursionlimit(), Tower of Hanoi/Fibonacci। Modules (9 प्रश्न): मॉड्यूल नेमस्पेस (2 प्रश्न), math (degrees, sqrt, pi, e), sys.modules, sys.argv (कमांड-लाइन आर्गुमेंट्स), TensorFlow व SymPyHighest Priority (अति महत्वपूर्ण)
3. Algorithms, Flowcharts, Time Complexity (Big-O) & OOPs (Units 1, 2 + New Trend)20 प्रश्न (20%)Flowchart & Basics (12 प्रश्न): डायमंड/ओवल/रेक्टेंगल सिंबल व नियम, Iterative प्रोसेसिंग, Decimal 25 का Binary (11001), Prime नंबर में sqrt(n) ऑप्टिमाइजेशन, Euclid GCD(48,18) चरण, अंकों को रिवर्स करने का मॉड्यूलो लॉजिक, Dry Run, Debugging बनाम Testing, PVM बाइटकोड, 1GL–4GL मिलान। Big-O Complexity & OOPs (8 प्रश्न — नया ट्रेंड): Binary Search O(log n), Dynamic List append स्पेस O(n), Dictionary एक्सेस O(1), Polymorphism (मेथड ओवरराइडिंग) व super() फंक्शनHigh Priority (अति महत्वपूर्ण – नया बदलाव)
4. Operators, Control Statements & Loops (Unit 3)12 प्रश्न (12%)एक्सप्रेशन आउटपुट, Chained Assignment (a=b=c=5 दाएं से बाएं मूल्यांकन), == बनाम is ऑपरेटर ([1,2] == [1,2] True पर is False), // फ्लोर डिवीज़न, ^ बिटवाइज़ XOR, for-else व while-else में break/continue का प्रभाव, assert स्टेटमेंट (AssertionError)High Priority (अति महत्वपूर्ण)
5. NumPy Library (Unit 8)9 प्रश्न (9%)एरे एट्रिब्यूट्स मिलान (ndim, shape, size, dtype), 1D shape (4,), क्रिएशन फंक्शन्स (zeros, ones, eye, linspace, logspace), np.linspace(0, 1, 5)[2] = 0.5, 2D स्लाइसिंग arr[1, :2], np.asarray(), np.fft.fft(), dtype परिवर्तनMedium-High Priority (स्कोरिंग यूनिट)
6. File Handling (Unit 7)9 प्रश्न (9%)फ़ाइल मोड्स मिलान (‘r’ डिफ़ॉल्ट, ‘w’ ओवरराइट, ‘a’ अपेंड, ‘r+’), seek() और tell() के 4 प्रश्न (seek(0,1) करंट पोजीशन, seek(2) के बाद read() आउटपुट ‘cde’), readline() बनाम readlines() (A&R), write() बनाम writelines()Medium-High Priority (स्कोरिंग यूनिट)
  • July 2026 के अनुसार सबसे मज़बूत रखने योग्य सब-टॉपिक्स:
    • Functions, Scope (LEGB) & Recursion: जुलाई 2026 में Functions + Modules + Recursion से 24 प्रश्न आए! LEGB नियम, global/nonlocal, sys.setrecursionlimit(1000), और म्यूटेबल डिफ़ॉल्ट आर्गुमेंट अवश्य पढ़ें।
    • Data Types Mutability & Slicing: List रेफरेंसिंग (b = a), == बनाम is, String/List स्लाइसिंग, और Dictionary का get() मेथड।
    • File Pointer (seek & tell) और NumPy (linspace, shape): seek() के ऑफसेट (0=Beginning, 1=Current, 2=End) से अकेले 4 प्रश्न पूछे गए। साथ ही Binary Search O(log n) और बेसिक OOPs (super(), Polymorphism) की परिभाषा भी देख कर जाएं।
  • छात्रों के लिए Smart Exam Tip:
    • M3-R5 में यदि छात्र Data Types (26 अंक) + Functions/Modules (24 अंक) + File Handling & NumPy (18 अंक) के नियम और छोटे आउटपुट पक्के कर लें, तो लंबे कथन वाले प्रश्नों में भी एलिमिनेशन मेथड से 80+ अंक आसानी से ला सकते हैं।

SET- 1

Q. 1. किस वेरिएबल का स्कोप लोकल (Local Scope) होता है?
Which variable has a local scope in Python?
(A) Variable declared outside all functions
(B) Variable declared using the global keyword
(C) Built-in system variable
(D) Variable declared inside a function
Correct Answer: (D) Variable declared inside a function
Explanation: जब किसी वेरिएबल को किसी फंक्शन के अंदर (Inside a function) डिक्लेयर किया जाता है, तो उसका स्कोप केवल उसी फंक्शन तक सीमित रहता है और उसे लोकल वेरिएबल कहते हैं।

Q. 2. निम्नलिखित Python कोड का आउटपुट क्या होगा?
What will be the output of the following Python code?
s = “Python”
print(s[-1:-4])
(A) noh
(B) hty
(C) Python
(D) ” (Empty string)
Correct Answer: (D) ” (Empty string)
Explanation: स्लाइसिंग s[-1:-4] में डिफ़ॉल्ट स्टेप +1 (बाएं से दाएं) होता है, जबकि इंडेक्स -1 से -4 पीछे (दाएं से बाएं) की ओर है; इसलिए आगे कोई अक्षर न मिलने पर यह खाली स्ट्रिंग (”) लौटाएगा।

Q. 3. निम्नलिखित NumPy कोड का आउटपुट क्या होगा?
What is the output of the following NumPy code?
import numpy as np
print(np.arange(1, 10, 2))
(A) [1 3 5 7 9]
(B) [2 4 6 8 10]
(C) [1 2 3 4 5 6 7 8 9]
(D) [1 3 5 7 9 11]
Correct Answer: (A) [1 3 5 7 9]
Explanation: np.arange(1, 10, 2) 1 से शुरू करके 2-2 के अंतर (Step) से 10 से ठीक पहले तक की विषम संख्याओं का एरे [1 3 5 7 9] बनाता है।

Q. 4. Python मॉड्यूल (Module) फाइल के लिए किस फाइल एक्सटेंशन का उपयोग किया जाता है?
Which file extension is used for a Python module?
(A) .py
(B) .mod
(C) .pt
(D) .px
Correct Answer: (A) .py
Explanation: कोई भी साधारण Python फाइल जिसमें फंक्शन्स, क्लासेस या वेरिएबल्स लिखे होते हैं, एक मॉड्यूल कहलाती है और उसका एक्सटेंशन .py होता है।

Q. 5. कौन सा कथन टेस्टिंग (Testing) और डीबगिंग (Debugging) के बीच के गहरे संबंध को सबसे अच्छी तरह से दर्शाता है?
Which statement best captures the deep relationship between Testing and Debugging?
(A) Both are used only for hardware repairing
(B) Debugging is done before writing any code
(C) Testing fixes errors, while debugging creates new errors
(D) Testing identifies/reveals the presence of defects (errors), while debugging locates their cause and fixes them
Correct Answer: (D) Testing identifies/reveals the presence of defects (errors), while debugging locates their cause and fixes them
Explanation: टेस्टिंग का मुख्य काम प्रोग्राम को चलाकर यह पता लगाना है कि उसमें कोई कमी या बग है, जबकि डीबगिंग का काम उस एरर के कारण को ढूंढकर उसे ठीक करना है।

Q. 6. Python के LEGB नियम के अनुसार किसी वेरिएबल नाम को खोजते समय सबसे पहले किस स्कोप को चेक किया जाता है?
According to the LEGB rule in Python, which scope is searched first?
(A) Global
(B) Built-in
(C) Enclosing
(D) Local
Correct Answer: (D) Local
Explanation: LEGB (Local -> Enclosing -> Global -> Built-in) नियम के अनुसार Python इंटरप्रेटर किसी भी वेरिएबल को सबसे पहले Local स्कोप में ढूंढता है।

Q. 7. निम्नलिखित Python कोड का आउटपुट क्या होगा?
What is the output of the following Python code?
x = 10
def f():
x = 20
print(x, end=” “)
f()
print(x)
(A) 10 10
(B) 20 20
(C) 20 10
(D) 10 20
Correct Answer: (C) 20 10
Explanation: फंक्शन f() के अंदर लोकल वेरिएबल x का मान 20 है इसलिए पहले 20 प्रिंट होगा, और फंक्शन के बाहर ग्लोबल वेरिएबल x का मान 10 ही सुरक्षित है इसलिए बाद में 10 प्रिंट होगा।

Q. 8. प्रोग्रामिंग में रिकर्शन (Recursion) का क्या अर्थ होता है?
What does Recursion mean in programming?
(A) A loop that never ends
(B) Importing an external module
(C) A function calling itself
(D) Deleting a file from disk
Correct Answer: (C) A function calling itself
Explanation: जब कोई फंक्शन किसी बड़ी समस्या को हल करने के लिए अपनी ही बॉडी के अंदर से खुद को दोबारा कॉल करता है, तो इस प्रक्रिया को रिकर्शन (Recursion) कहते हैं।

Q. 9. निम्नलिखित में से कौन सा स्टेटमेंट Python में एक सेट (Set) बनाता है?
Which of the following creates a Set in Python?
(A) s = {1, 2, 3}
(B) s = [1, 2, 3]
(C) s = (1, 2, 3)
(D) s = {}
Correct Answer: (A) s = {1, 2, 3}
Explanation: कर्ली ब्रैकेट्स के अंदर बिना Key:Value के कॉमा लगाकर एलिमेंट्स लिखने पर ({1, 2, 3}) एक सेट बनता है (जबकि खाली {} एक खाली डिक्शनरी बनाता है)।

Q. 10. यदि किसी इटरेटिव फ्लोचार्ट या लूप में लूप कंट्रोल वेरिएबल को अपडेट नहीं किया जाता है, तो कौन सी समस्या होने की सबसे अधिक संभावना है?
Which of the following errors is most likely if a loop control variable is not updated in an iterative flowchart?
(A) Syntax Error
(B) Indentation Error
(C) Division by Zero
(D) Infinite Loop
Correct Answer: (D) Infinite Loop
Explanation: यदि लूप चलाने वाले वेरिएबल को लूप के अंदर बढ़ाया या घटाया (Update) न जाए, तो लूप की शर्त कभी False नहीं होगी और प्रोग्राम अनंत लूप (Infinite Loop) में फंस जाएगा।

Q. 11. निम्नलिखित Python कोड क्या प्रिंट करेगा?
What does the following Python code print?
from math import *
print(cos(0))
(A) 1.0
(B) 0.0
(C) -1.0
(D) Error
Correct Answer: (A) 1.0
Explanation: गणित में cos(0) का मान 1 होता है, और Python के math मॉड्यूल का cos() फंक्शन परिणाम को फ्लोट रूप में 1.0 लौटाता है।

Q. 12. निम्नलिखित Python कोड का आउटपुट क्या होगा?
What will be the output of the following Python code?
a = [1, 2, 3]
b = a
b.append(4)
print(a)
(A) [1, 2, 3]
(B) [1, 2, 3, 4]
(C) [4]
(D) Error
Correct Answer: (B) [1, 2, 3, 4]
Explanation: Python में b = a लिखने पर नई लिस्ट नहीं बनती बल्कि दोनों वेरिएबल मेमोरी की एक ही लिस्ट को पॉइंट करते हैं; इसलिए b.append(4) करने पर मूल लिस्ट a भी बदलकर [1, 2, 3, 4] हो जाएगी।

Q. 13. निम्नलिखित में से कौन सा विकल्प सबसे अच्छी तरह बताता है कि कंपाइल्ड भाषाओं की तुलना में Python प्रोग्राम को डीबग (Debug) करना आसान क्यों है?
Which of the following best explains why Python programs are easier to debug compared to compiled languages?
(A) Python ignores all syntax and runtime errors
(B) Python does not require any variables
(C) Python executes code line by line and reports errors immediately with a clear traceback
(D) Python automatically rewrites wrong logic
Correct Answer: (C) Python executes code line by line and reports errors immediately with a clear traceback
Explanation: Python एक इंटरप्रेटेड भाषा है जो कोड को लाइन-दर-लाइन चलाती है और जिस भी लाइन में गलती होती है, वहीं तुरंत स्पष्ट एरर मैसेज दिखाकर रुक जाती है।

Q. 14. NumPy में ndarray.shape एट्रिब्यूट क्या रिटर्न करता है?
What does ndarray.shape return in NumPy?
(A) A tuple of integers representing the array dimensions (rows, columns, etc.)
(B) A single string of all elements
(C) The memory address of the array
(D) A boolean value True or False
Correct Answer: (A) A tuple of integers representing the array dimensions (rows, columns, etc.)
Explanation: NumPy में किसी एरे का .shape एट्रिब्यूट उसके प्रत्येक डायमेंशन के आकार (जैसे 2×3 मैट्रिक्स के लिए (2, 3)) को एक टपल (Tuple) के रूप में लौटाता है।

Q. 15. डीबगिंग (Debugging) के बारे में निम्नलिखित में से कौन सा कथन सही है?
Which statement about Debugging is correct?
(A) Debugging is the process of finding and fixing errors (bugs) in a program
(B) Debugging is the process of deleting the operating system
(C) Debugging means converting Python code into HTML
(D) Debugging is used to slow down CPU speed
Correct Answer: (A) Debugging is the process of finding and fixing errors (bugs) in a program
Explanation: किसी कंप्यूटर प्रोग्राम के सोर्स कोड में मौजूद गलतियों (Bugs) को ढूंढने और उन्हें सुधारने की प्रक्रिया को डीबगिंग कहते हैं।

Q. 16. फाइबोनाची अनुक्रम (Fibonacci Sequence) जनरेट करने वाला एल्गोरिदम मुख्य रूप से किस प्रोग्रामिंग अवधारणा को प्रदर्शित करता है?
The Fibonacci sequence algorithm mainly demonstrates ______.
(A) File deletion on hard disk
(B) Only static constant printing
(C) Iterative processing with continuous variable updates (or recursion)
(D) Database table dropping
Correct Answer: (C) Iterative processing with continuous variable updates (or recursion)
Explanation: फाइबोनाची अनुक्रम (0, 1, 1, 2, 3, 5…) में हर अगली संख्या पिछली दो संख्याओं के योग से बनती है, जो लूप के साथ वेरिएबल्स के निरंतर अपडेट (Iterative processing) को दर्शाता है।

Q. 17. किसी 2D NumPy एरे में इंडेक्सिंग arr[1, 2] किसे संदर्भित करता है?
In 2D slicing/indexing, what does arr[1, 2] refer to?
(A) Row 1, Column 1
(B) Row 2, Column 1
(C) Element at row index 1 (second row) and column index 2 (third column)
(D) A new 3D array
Correct Answer: (C) Element at row index 1 (second row) and column index 2 (third column)
Explanation: 2D एरे में पहला नंबर रो इंडेक्स और दूसरा नंबर कॉलम इंडेक्स होता है; इसलिए arr[1, 2] रो इंडेक्स 1 और कॉलम इंडेक्स 2 पर मौजूद एलिमेंट को दर्शाता है।

Q. 18. निम्नलिखित Python कोड का आउटपुट क्या होगा?
What is the output of the following Python code?
d = {1: ‘a’, 2: ‘b’, 1: ‘c’}
print(d)
(A) {1: ‘a’, 2: ‘b’, 1: ‘c’}
(B) {1: ‘a’, 2: ‘b’}
(C) {1: ‘c’, 2: ‘b’}
(D) SyntaxError
Correct Answer: (C) {1: ‘c’, 2: ‘b’}
Explanation: Python डिक्शनरी में डुप्लीकेट Keys की अनुमति नहीं होती; यदि एक ही Key (यहाँ 1) को दोबारा लिखा जाए, तो उसकी पुरानी वैल्यू (‘a’) नई वैल्यू (‘c’) से ओवरराइट हो जाती है।

Q. 19. Python में assert स्टेटमेंट क्या कार्य करता है?
What does the assert statement do in Python?
(A) Deletes all variables in the program
(B) Closes all open files
(C) Always prints True on screen
(D) Raises an AssertionError if the given condition evaluates to False
Correct Answer: (D) Raises an AssertionError if the given condition evaluates to False
Explanation: डीबगिंग के लिए उपयोग होने वाला assert स्टेटमेंट किसी शर्त की जांच करता है; यदि शर्त True हो तो प्रोग्राम आगे बढ़ता है, लेकिन शर्त False होने पर यह तुरंत AssertionError देता है।

Q. 20. निम्नलिखित Python कोड का आउटपुट क्या होगा?
What is the output of the following Python code?
def f(x):
x = 10
a = 5
f(a)
print(a)
(A) 10
(B) 5
(C) None
(D) Error
Correct Answer: (B) 5
Explanation: Python में इंटीजर इम्यूटेबल होते हैं; फंक्शन f(x) के अंदर x = 10 करने से केवल लोकल वेरिएबल x बदलता है, बाहर के ग्लोबल वेरिएबल a का मान 5 ही रहता है।

Q. 21. कौन सा स्टेटमेंट किसी मॉड्यूल में से पूरे मॉड्यूल के बजाय केवल चुने हुए फंक्शन या नाम (जैसे sqrt) को इम्पोर्ट करता है?
Which statement imports only a selected name from a module?
(A) import math.sqrt
(B) include sqrt from math
(C) from math import sqrt
(D) using math.sqrt
Correct Answer: (C) from math import sqrt
Explanation: किसी मॉड्यूल से केवल एक विशेष फंक्शन या वेरिएबल इम्पोर्ट करने के लिए ‘from module_name import object_name’ (जैसे from math import sqrt) सिंटैक्स का उपयोग होता है।

Q. 22. यदि s = "Python" है, तो "yth" प्राप्त करने के लिए कौन सा स्ट्रिंग स्लाइसिंग एक्सप्रेशन उपयोग किया जाता है?
Which string slicing expression gives the output "yth" from s = "Python"?
(A) s[1:4]
(B) s[2:5]
(C) s[0:3]
(D) s[1:3]
Correct Answer: (A) s[1:4]
Explanation: स्ट्रिंग “Python” में इंडेक्स 1 पर ‘y’, 2 पर ‘t’ और 3 पर ‘h’ है; स्लाइसिंग में अंतिम इंडेक्स शामिल नहीं होता, इसलिए s[1:4] से “yth” प्राप्त होगा (जबकि s[2:5] से “tho” मिलता है)।

Q. 23. नीचे दिए गए Python कोड का आउटपुट क्या होगा?
What will be the output of the given code below?
import math as m
print(m.pi)
(A) 3.141592653589793
(B) 22/7
(C) 3.0
(D) Error
Correct Answer: (A) 3.141592653589793
Explanation: math मॉड्यूल को उपनाम (Alias) m के रूप में इम्पोर्ट करने पर m.pi गणितीय स्थिरांक पाई (π) का सटीक फ्लोटिंग-पॉइंट मान 3.141592653589793 प्रिंट करता है।

Q. 24. किसी दूसरे फंक्शन (Outer Function) के अंदर डिफाइन किए गए फंक्शन (Nested/Inner Function) के लिए बाहरी फंक्शन द्वारा कौन सा स्कोप बनता है?
Which scope is created by a function defined inside another function (for the inner function)?
(A) Built-in Scope
(B) Global Scope
(C) Enclosing (Nonlocal) Scope
(D) Hardware Scope
Correct Answer: (C) Enclosing (Nonlocal) Scope
Explanation: नेस्टेड फंक्शन्स में बाहरी फंक्शन का स्कोप आंतरिक फंक्शन के लिए Enclosing (या Nonlocal) स्कोप कहलाता है।

Q. 25. निम्नलिखित Python कोड का आउटपुट क्या होगा?
What is the output of the following Python code?
f = open(“data.txt”, “r”)
f.seek(0)
print(f.tell())
f.close()
(A) 0
(B) 1
(C) -1
(D) EOF
Correct Answer: (A) 0
Explanation: f.seek(0) फाइल पॉइंटर को फाइल की बिल्कुल शुरुआत (0 बाइट ऑफसेट) पर ले जाता है, इसलिए f.tell() वर्तमान पोजिशन के रूप में 0 रिटर्न करेगा।

Q. 26. Python में कौन सा फाइल मेथड स्ट्रिंग्स की एक लिस्ट (List of strings) को फाइल में लिखता है?
Which file method writes a list of strings to a file in Python?
(A) writelines()
(B) write()
(C) readline()
(D) writelist()
Correct Answer: (A) writelines()
Explanation: फाइल में एक साथ कई लाइनों की लिस्ट (List of strings) को लिखने के लिए writelines() मेथड का उपयोग किया जाता है।

Q. 27. Python में किसी फाइल को खोलने (Open करने) के लिए किस बिल्ट-इन फंक्शन का उपयोग किया जाता है?
Which function is used to open a file in Python?
(A) file_open()
(B) open()
(C) start()
(D) readfile()
Correct Answer: (B) open()
Explanation: Python में किसी भी टेक्स्ट या बाइनरी फाइल को रीड या राइट मोड में खोलने के लिए बिल्ट-इन open(filename, mode) फंक्शन का उपयोग होता है।

Q. 28. निम्नलिखित Python कोड का आउटपुट क्या होगा?
What is the output of the following Python code?
x = 5
def f():
global x
x = 10
f()
print(x)
(A) 5
(B) 10
(C) 15
(D) Error
Correct Answer: (B) 10
Explanation: चूंकि फंक्शन f() के अंदर global x कीवर्ड का उपयोग करके ग्लोबल वेरिएबल x का मान 5 से बदलकर 10 कर दिया गया है, इसलिए f() कॉल होने के बाद print(x) का आउटपुट 10 आएगा।

Q. 29. निम्नलिखित Python कोड का आउटपुट क्या होगा?
What is the output of the following Python code?
x = 5
y = 10
print(x > 3 or y < 5 and x == 0)
(A) True
(B) False
(C) 5
(D) 10
Correct Answer: (A) True
Explanation: ऑपरेटर प्राथमिकता के अनुसार पहले and हल होगा (y < 5 and x == 0 जो False देगा), और फिर x > 3 (जो True है) के साथ or करने पर (True or False) अंतिम परिणाम True आएगा।

Q. 30. निम्नलिखित में से कौन सा Python प्रोग्राम यूजर से दो पूर्णांक संख्याएं इनपुट लेकर उनका सही योग (Sum) प्रिंट करता है?
Which of the following programs correctly prints the sum of two integer numbers entered by the user?
(A) print(input() + input())
(B) print(int(input()) + int(input()))
(C) print(str(input()) + str(input()))
(D) input(int() + int())
Correct Answer: (B) print(int(input()) + int(input()))
Explanation: input() फंक्शन हमेशा स्ट्रिंग लौटाता है; इसलिए दो संख्याओं को गणितीय रूप से जोड़ने के लिए पहले int(input()) से उन्हें पूर्णांक में बदलना आवश्यक है।

Q. 31. Python को मुख्य रूप से किस प्रकार की प्रोग्रामिंग भाषा के रूप में वर्गीकृत (Classify) किया गया है?
Python is classified as a ______.
(A) Low-level assembly language
(B) Statically typed machine language
(C) High-level, interpreted language with dynamic typing
(D) Hardware-only markup language
Correct Answer: (C) High-level, interpreted language with dynamic typing
Explanation: Python एक हाई-लेवल, इंटरप्रेटेड प्रोग्रामिंग भाषा है जिसमें डायनेमिक टाइपिंग (वेरिएबल का डेटा टाइप रनटाइम पर अपने आप तय होना) की सुविधा होती है।

Q. 32. Python में range(1, 10, 2) क्या जनरेट करता है?
What does range(1, 10, 2) generate in Python?
(A) Even numbers from 2 to 10
(B) Odd numbers from 1 to 9 (1, 3, 5, 7, 9)
(C) All numbers from 1 to 10
(D) Only 1 and 10
Correct Answer: (B) Odd numbers from 1 to 9 (1, 3, 5, 7, 9)
Explanation: range(1, 10, 2) 1 से शुरू होकर 2 के स्टेप से बढ़ते हुए 10 से पहले तक की सभी विषम संख्याएं (1, 3, 5, 7, 9) जनरेट करता है।

Q. 33. किसी स्ट्रिंग s पर s.count('a') मेथड कॉल करने पर यह क्या रिटर्न करता है?
What does s.count('a') return in Python?
(A) Index of the first ‘a’
(B) Frequency (total number of occurrences) of ‘a’ in string s
(C) A new string without ‘a’
(D) Boolean True or False
Correct Answer: (B) Frequency (total number of occurrences) of ‘a’ in string s
Explanation: स्ट्रिंग या लिस्ट का count() मेथड यह गिनकर बताता है कि दिया गया अक्षर या आइटम (‘a’) उस स्ट्रिंग में कुल कितनी बार (Frequency) आया है।

Q. 34. Python लिस्ट या टपल से एक नया NumPy एरे (Array) बनाने के लिए किस मुख्य फंक्शन का उपयोग किया जाता है?
Which function is used to create a NumPy array from a list or tuple?
(A) np.create()
(B) np.array()
(C) np.make_list()
(D) np.new()
Correct Answer: (B) np.array()
Explanation: NumPy में किसी साधारण Python लिस्ट या टपल से ndarray ऑब्जेक्ट बनाने के लिए np.array() फंक्शन का उपयोग किया जाता है।

Q. 35. निम्नलिखित Python कोड क्या आउटपुट देगा?
What is the output of the following Python code?
f = open(“data.txt”, “r”)
print(f.readline())
f.close()
(A) Reads and prints one single line from the file
(B) Deletes the entire file
(C) Prints only the file size in bytes
(D) Writes a new line into the file
Correct Answer: (A) Reads and prints one single line from the file
Explanation: फाइल हैंडलिंग में f.readline() मेथड फाइल की शुरुआत (या वर्तमान पॉइंटर) से केवल एक सिंगल लाइन पढ़कर स्ट्रिंग के रूप में लौटाता है।

Q. 36. कौन सा फाइल मोड एक नई फाइल बनाता है, लेकिन अगर वह फाइल पहले से मौजूद हो तो एरर (FileExistsError) देता है?
Which file mode creates a new file, but raises an error if the file already exists?
(A) ‘r’
(B) ‘w’
(C) ‘x’
(D) ‘a’
Correct Answer: (C) ‘x’
Explanation: एक्सक्लूसिव क्रिएशन मोड (‘x’) केवल नई फाइल बनाने के लिए होता है; यदि उस नाम की फाइल डिस्क पर पहले से मौजूद हो तो यह उसे ओवरराइट करने के बजाय FileExistsError देता है।

Q. 37. निम्नलिखित Python कोड का आउटपुट क्या होगा?
What is the output of the following Python code?
t = (10, 20, 30)
t = t + (40,)
print(t)
(A) (10, 20, 30)
(B) (10, 20, 30, 40)
(C) [10, 20, 30, 40]
(D) TypeError
Correct Answer: (B) (10, 20, 30, 40)
Explanation: यद्यपि टपल इम्यूटेबल होता है, लेकिन दो टपल्स को + ऑपरेटर से जोड़कर (Concatenation करके) एक नया टपल (10, 20, 30, 40) बनाया जा सकता है।

Q. 38. निम्नलिखित Python कोड का आउटपुट क्या होगा?
What is the output of the following Python code?
print(type(5 + 3.0))
(A) <class ‘int’>
(B) <class ‘float’>
(C) <class ‘str’>
(D) <class ‘complex’>
Correct Answer: (B) <class ‘float’>
Explanation: जब किसी पूर्णांक (5) और फ्लोट (3.0) को जोड़ा जाता है, तो Python इम्प्लिसिट टाइप कन्वर्जन द्वारा परिणाम को फ्लोट (8.0) में बदल देता है, जिसका डेटा टाइप <class ‘float’> होता है।

Q. 39. जब किसी Python मॉड्यूल को प्रोग्राम में पहली बार import किया जाता है, तो उसके टॉप-लेवल कोड का क्या होता है?
When a module is imported in Python, its top-level code is ______.
(A) Deleted from the file
(B) Executed infinite times
(C) Executed once (when first imported)
(D) Never executed at all
Correct Answer: (C) Executed once (when first imported)
Explanation: किसी Python प्रोग्राम में जब कोई मॉड्यूल इम्पोर्ट किया जाता है, तो उसके अंदर लिखा टॉप-लेवल कोड केवल पहली बार इम्पोर्ट होने पर एक बार (Executed once) रन होता है।

Q. 40. किसी संख्या के फैक्टोरियल (Factorial) की गणना करने वाले एल्गोरिदम में गुणनफल स्टोर करने वाले परिणाम वेरिएबल को किस मान से इनिशियलाइज़ (Initialize) किया जाना चाहिए?
In an algorithm calculating the factorial of a number, the factorial result variable should be initialized to 1—what does this variable represent?
(A) Loop termination error
(B) Factorial accumulator / initial factorial value (since 0! = 1 and multiplicative identity is 1)
(C) Division remainder
(D) String length
Correct Answer: (B) Factorial accumulator / initial factorial value (since 0! = 1 and multiplicative identity is 1)
Explanation: फैक्टोरियल में संख्याओं का क्रमिक गुणा (1 * 2 * 3 * … * n) होता है; यदि वेरिएबल को 0 से शुरू करेंगे तो पूरा गुणनफल 0 हो जाएगा, इसलिए फैक्टोरियल वेरिएबल को हमेशा 1 से इनिशियलाइज़ किया जाता है।

Q. 41. Python में मॉड्यूल्स (Modules) नामों के टकराव (Name Collisions) को रोकने के लिए किस रूप में काम करते हैं?
Modules in Python act as ______ to prevent name collisions.
(A) Loops
(B) Syntax Errors
(C) Flowcharts
(D) Namespaces
Correct Answer: (D) Namespaces
Explanation: प्रत्येक मॉड्यूल अपना एक अलग नेमस्पेस (Namespace) बनाता है, जिससे दो अलग-अलग मॉड्यूल्स में एक ही नाम के फंक्शन या वेरिएबल बिना किसी टकराव के रखे जा सकते हैं।

Q. 42. अगर 'w' (Write) मोड में खोली गई फाइल डिस्क पर पहले से मौजूद हो, तो क्या होता है?
If a file opened in 'w' mode already exists on the disk, what happens?
(A) File is deleted and cannot be created again
(B) New data is appended at the end without touching old data
(C) Python raises a SyntaxError
(D) The existing file is truncated and overwritten (पुराना डेटा मिटकर नया डेटा ओवरराइट हो जाता है)
Correct Answer: (D) The existing file is truncated and overwritten (पुराना डेटा मिटकर नया डेटा ओवरराइट हो जाता है)
Explanation: ‘w’ मोड में फाइल खोलने पर यदि फाइल पहले से मौजूद है, तो उसका सारा पुराना डेटा मिट (Truncate हो) जाता है और नई सामग्री उस पर ओवरराइट हो जाती है।

Q. 43. मान लीजिए दो एल्गोरिदम A और B एक ही समस्या को हल करने के लिए बने हैं। एल्गोरिदम A हमेशा समाप्त (Terminate) हो जाता है लेकिन कभी-कभी गलत आउटपुट देता है, जबकि एल्गोरिदम B सही आउटपुट देता है लेकिन कुछ इनपुट्स के लिए कभी समाप्त नहीं होता। कौन सा कथन सही है?
Suppose two algorithms A and B solve the same problem. Algorithm A always terminates but sometimes gives wrong output, while Algorithm B gives correct output but does not terminate for some inputs. Which statement is true?
(A) Both A and B are ideal algorithms
(B) Only A is a valid algorithm
(C) Only B is a valid algorithm
(D) Both violate essential properties of a good algorithm (A violates Correctness, B violates Finiteness)
Correct Answer: (D) Both violate essential properties of a good algorithm (A violates Correctness, B violates Finiteness)
Explanation: एक वैध एल्गोरिदम में Correctness (हमेशा सही उत्तर देना) और Finiteness (निश्चित चरणों में समाप्त होना) दोनों गुण अनिवार्य हैं; इसलिए A और B दोनों एल्गोरिदम के मूल गुणों का उल्लंघन करते हैं।

Q. 44. कौन सा कीवर्ड किसी फंक्शन के अंदर से ग्लोबल वेरिएबल (Global Variable) के मान में बदलाव करने की अनुमति देता है?
Which keyword allows modification of a global variable inside a function?
(A) local
(B) static
(C) global
(D) extern
Correct Answer: (C) global
Explanation: फंक्शन के अंदर ग्लोबल वेरिएबल को नया मान असाइन करने या बदलने के लिए global कीवर्ड (जैसे global x) का उपयोग किया जाता है।

Q. 45. Python में कमांड-लाइन आर्गुमेंट्स (Command-line arguments) को किसका उपयोग करके एक्सेस किया जाता है?
Command-line arguments in Python are accessed using ______.
(A) os.path
(B) sys.argv
(C) math.args
(D) random.cmd
Correct Answer: (B) sys.argv
Explanation: कमांड लाइन से स्क्रिप्ट चलाते समय पास किए गए आर्गुमेंट्स को Python के sys मॉड्यूल की लिस्ट sys.argv के माध्यम से एक्सेस किया जाता है।

Q. 46. कौन सी सूक्ष्म कमी एक फ्लोचार्ट को लॉजिकली गलत बना देती है, भले ही उसके सभी सिंबल सिंटैक्स के हिसाब से सही बने हों?
Which subtle flaw makes a flowchart logically incorrect even if all symbols are syntactically valid?
(A) Using black ink instead of blue ink
(B) Drawing boxes slightly smaller
(C) Using short variable names
(D) A decision block with branches/paths that do not reconverge logically or lead to a dead end without reaching Stop
Correct Answer: (D) A decision block with branches/paths that do not reconverge logically or lead to a dead end without reaching Stop
Explanation: यदि किसी डिसीजन बॉक्स से निकलने वाले रास्ते आगे चलकर तार्किक रूप से सही जगह न मिलें या End/Stop तक न पहुंचें, तो वह फ्लोचार्ट लॉजिकली गलत हो जाता है।

Q. 47. निम्नलिखित में से कौन सा डेटा टाइप इम्यूटेबल (Immutable / अपरिवर्तनीय) है?
Which of the following data types is immutable in Python?
(A) List
(B) Dictionary
(C) Set
(D) Tuple
Correct Answer: (D) Tuple
Explanation: List, Dictionary और Set म्यूटेबल हैं, जबकि Tuple एक इम्यूटेबल (अपरिवर्तनीय) डेटा टाइप है।

Q. 48. लूप का उपयोग करके ‘n’ संख्याओं का योग (Summation of n numbers) निकालने वाले फ्लोचार्ट में कम से कम कितने डिसीजन बॉक्स (Decision Box / Diamond) की आवश्यकता होती है?
For calculating the summation of ‘n’ numbers using a loop in a flowchart, the minimum number of decision boxes required is ______.
(A) 0
(B) 1
(C) 5
(D) 10
Correct Answer: (B) 1
Explanation: 1 से n तक की संख्याओं का योग करने के लिए लूप की शर्त (जैसे i <= n) चेक करने हेतु कम से कम 1 डिसीजन बॉक्स (डायमंड सिंबल) की आवश्यकता होती है।

Q. 49. निम्नलिखित Python कोड का आउटपुट क्या होगा?
What is the output of the following Python code?
s = [0, 1, 2, 3, 4, 5]
print(s[1:5:2])
(A) [1, 3]
(B) [1, 2, 3, 4]
(C) [0, 2, 4]
(D) [1, 3, 5]
Correct Answer: (A) [1, 3]
Explanation: स्लाइसिंग s[1:5:2] इंडेक्स 1 से शुरू होकर इंडेक्स 5 से पहले तक 2-2 के कदम (Step=2) से चलेगी, जिससे इंडेक्स 1 और 3 के मान यानी [1, 3] प्राप्त होंगे।

Q. 50. कौन सा मापदंड सबसे बेहतर ढंग से यह तय करता है कि किसी फ्लोचार्ट का समाधान सही और पूर्ण (Correct and Complete) है?
Which criterion best determines whether a flowchart solution is correct and complete?
(A) It uses maximum number of colourful shapes
(B) It fits on a small piece of paper
(C) It produces the correct output for all valid inputs (including edge cases) and terminates properly
(D) It contains no decision boxes at all
Correct Answer: (C) It produces the correct output for all valid inputs (including edge cases) and terminates properly
Explanation: कोई भी फ्लोचार्ट या एल्गोरिदम तभी पूर्ण और सही माना जाता है जब वह सभी वैध इनपुट्स के लिए हमेशा सही आउटपुट दे और निश्चित चरणों में समाप्त हो।

Q. 51. किसी एरे या लिस्ट में एलिमेंट्स के क्रम को इन-प्लेस उलटने (Reverse) के लिए एल्गोरिदम में किन एलिमेंट्स को आपस में स्वैप (Swap) करना होता है?
To reverse the order of elements in an array in-place, the algorithm swaps elements between ______.
(A) Only the first two elements repeatedly
(B) First and last, second and second-last, and so on towards the center
(C) Only adjacent odd elements
(D) Middle element with itself
Correct Answer: (B) First and last, second and second-last, and so on towards the center
Explanation: एरे को रिवर्स करने के लिए पहले एलिमेंट को आखिरी से, दूसरे को सेकंड-लास्ट से (अर्थात इंडेक्स i को n-1-i से) मध्य तक आपस में बदला (Swap किया) जाता है।

Q. 52. निम्नलिखित में से कौन सा बिल्ट-इन डेटा टाइप इम्यूटेबल (Immutable) होता है?
Which built-in data type is immutable in Python?
(A) list
(B) dict
(C) set
(D) str (String)
Correct Answer: (D) str (String)
Explanation: Python में स्ट्रिंग (str) इम्यूटेबल होती है; एक बार स्ट्रिंग बनने के बाद उसके किसी अक्षर को इंडेक्स के जरिए सीधे बदला नहीं जा सकता।

Q. 53. जब सिंटैक्स के हिसाब से किसी लूप या फंक्शन बॉडी में स्टेटमेंट होना जरूरी हो, लेकिन वहां कोई एक्शन (कार्य) न कराना हो, तो किस स्टेटमेंट का उपयोग किया जाता है?
Which statement is used when a loop or function body is syntactically required, but no action is needed?
(A) pass
(B) break
(C) continue
(D) exit
Correct Answer: (A) pass
Explanation: Python में pass एक नल (Null) ऑपरेशन स्टेटमेंट है जिसका उपयोग खाली लूप, फंक्शन या क्लास में प्लेसहोल्डर के रूप में किया जाता है ताकि IndentationError न आए।

Q. 54. निम्नलिखित Python कोड का आउटपुट क्या होगा?
What is the output of the following Python code?
print(round(4.567, 2))
(A) 4.56
(B) 4.57
(C) 4.5
(D) 5.0
Correct Answer: (B) 4.57
Explanation: round(4.567, 2) संख्या को दशमलव के 2 स्थानों तक राउंड करेगा; चूंकि तीसरा अंक 7 (5 से बड़ा) है, इसलिए 6 बढ़कर 7 हो जाएगा और आउटपुट 4.57 मिलेगा।

Q. 55. Python में सिंटैक्स एरर (SyntaxError) का पता किस चरण के दौरान चलता है?
A SyntaxError in Python is detected during the ______.
(A) Compilation / Parsing phase (before program execution starts)
(B) After the entire program finishes printing output
(C) Only when saving the file in Notepad
(D) Hardware booting phase
Correct Answer: (A) Compilation / Parsing phase (before program execution starts)
Explanation: जब Python प्रोग्राम चलाया जाता है, तो बाइटकोड में बदलने (Parsing/Compilation phase) के दौरान ही कोड की पहली लाइन चलने से पहले SyntaxError पकड़ ली जाती है।

Q. 56. Python डिक्शनरी (Dictionary) के बारे में निम्नलिखित में से कौन सा कथन सत्य है?
Which statement about a Dictionary in Python is TRUE?
(A) Dictionary keys can be mutable lists
(B) A dictionary cannot store numbers
(C) Dictionary elements are accessed only by 0-based position index
(D) Dictionary keys must be unique and immutable
Correct Answer: (D) Dictionary keys must be unique and immutable
Explanation: Python डिक्शनरी में प्रत्येक Key अद्वितीय (Unique) और इम्यूटेबल (जैसे स्ट्रिंग, नंबर या टपल) होनी चाहिए, जबकि Values कुछ भी हो सकती हैं।

Q. 57. निम्नलिखित Python कोड का आउटपुट क्या होगा?
What will be the output of the following Python code?
print(type({1, 2, 3}))
(A) <class ‘set’>
(B) <class ‘dict’>
(C) <class ‘list’>
(D) <class ‘tuple’>
Correct Answer: (A) <class ‘set’>
Explanation: कर्ली ब्रैकेट्स के अंदर बिना कोलन (:) के लिखे गए एलिमेंट्स {1, 2, 3} एक सेट (Set) होते हैं, इसलिए type() फंक्शन <class ‘set’> रिटर्न करेगा।

Q. 58. निम्नलिखित Python कोड का आउटपुट क्या होगा?
What is the output of the following Python code?
def test():
x = 5
print(test())
(A) 5
(B) 0
(C) None
(D) Error
Correct Answer: (C) None
Explanation: जिस Python फंक्शन में कोई return स्टेटमेंट नहीं होता, वह डिफ़ॉल्ट रूप से हमेशा None ऑब्जेक्ट रिटर्न करता है।

Q. 59. किसी संख्या ‘n’ के अभाज्य (Prime Number) होने की जांच करने वाले कुशल एल्गोरिदम में भाजक (Divisor) का लूप आमतौर पर कहाँ से कहाँ तक चलाया जाता है?
In an efficient prime-checking algorithm for number ‘n’, the loop typically runs from ______.
(A) 0 to n
(B) 1 to n*n
(C) n to 2n
(D) 2 to √n (2 to square root of n)
Correct Answer: (D) 2 to √n (2 to square root of n)
Explanation: किसी संख्या n के प्राइम होने की जांच करने के लिए उसे 2 से लेकर केवल उसके वर्गमूल (√n यानी int(n**0.5)) तक की संख्याओं से भाग देकर देखना ही पर्याप्त होता है।

Q. 60. कौन सा स्टेटमेंट पूरे math मॉड्यूल को प्रोग्राम में इम्पोर्ट करता है?
Which statement imports the entire math module in Python?
(A) import math
(B) math.import()
(C) include math
(D) using math
Correct Answer: (A) import math
Explanation: पूरे मॉड्यूल को इम्पोर्ट करने के लिए import कीवर्ड के साथ मॉड्यूल का नाम (import math) लिखा जाता है।

Q. 61. निम्नलिखित Python एक्सप्रेशन का आउटपुट क्या होगा?
What is the output of the following Python expression?
print(10 // 3)
(A) 3.33
(B) 3
(C) 1
(D) 3.0
Correct Answer: (B) 3
Explanation: फ्लोर डिवीजन ऑपरेटर (//) भाग देने के बाद दशमलव के हिस्से को हटाकर केवल पूर्णांक भागफल (Quotient = 3) लौटाता है।

Q. 62. NumPy लाइब्रेरी में सबसे मुख्य डेटा स्ट्रक्चर ऑब्जेक्ट कौन सा होता है?
What is the main object in NumPy?
(A) DataFrame
(B) Series
(C) LinkedList
(D) ndarray (N-dimensional array)
Correct Answer: (D) ndarray (N-dimensional array)
Explanation: NumPy का मुख्य आधार उसका समरूप (Homogeneous) बहु-आयामी एरे ऑब्जेक्ट है जिसे ndarray कहा जाता है।

Q. 63. यूक्लिड की विधि (Euclid’s Method) का उपयोग करके दो संख्याओं a और b का महत्तम समापवर्तक (GCD) ज्ञात करने वाले एल्गोरिदम में किस लूप कंडीशन का उपयोग किया जाता है?
Which loop condition is used in the algorithm to find the GCD of two numbers a and b using Euclid’s method?
(A) while b == 0:
(B) while a < 0:
(C) while b != 0:
(D) while a == b:
Correct Answer: (C) while b != 0:
Explanation: यूक्लिड के GCD एल्गोरिदम में तब तक a, b = b, a % b किया जाता है जब तक कि शेषफल यानी दूसरा नंबर b शून्य के बराबर न हो जाए (while b != 0:)।

Q. 64. निम्नलिखित Python कोड का आउटपुट क्या होगा?
What is the output of the following Python code?
lst = [1, 2, 3, 4]
print(lst[::-1])
(A) [1, 2, 3, 4]
(B) [4, 3, 2, 1]
(C) [4]
(D) [1]
Correct Answer: (B) [4, 3, 2, 1]
Explanation: स्लाइसिंग [::-1] में स्टेप -1 होने के कारण यह पूरी लिस्ट को पीछे से आगे की ओर उलट (Reverse) कर [4, 3, 2, 1] लौटाता है।

Q. 65. Python फाइल हैंडलिंग में tell() मेथड क्या रिटर्न करता है?
What does the tell() method return in Python file handling?
(A) Total number of lines in the file
(B) Name of the file
(C) File extension
(D) Current file pointer position (offset in bytes from the beginning of the file)
Correct Answer: (D) Current file pointer position (offset in bytes from the beginning of the file)
Explanation: फाइल ऑब्जेक्ट का tell() मेथड यह बताता है कि वर्तमान में फाइल पॉइंटर (कर्सर) फाइल की शुरुआत से कितने बाइट्स की दूरी (Current position) पर है।

Q. 66. Python में बिल्ट-इन eval() फंक्शन क्या कार्य करता है?
What does the eval() function do in Python?
(A) Deletes a string variable
(B) Evaluates a string as a valid Python expression and returns the result
(C) Closes the Python interpreter
(D) Converts an integer into a file object
Correct Answer: (B) Evaluates a string as a valid Python expression and returns the result
Explanation: eval() फंक्शन स्ट्रिंग के अंदर लिखे गए गणितीय या Python एक्सप्रेशन (जैसे eval(“2 + 3 * 4”)) को पार्स और हल करके उसका वास्तविक परिणाम (14) लौटाता है।

Q. 67. निम्नलिखित Python कोड का आउटपुट क्या होगा?
What is the output of the following Python code?
def add(a, b=5):
return a + b
print(add(3))
(A) 3
(B) 5
(C) 8
(D) Error
Correct Answer: (C) 8
Explanation: फंक्शन कॉल add(3) में केवल एक आर्गुमेंट (a=3) भेजा गया है, इसलिए b अपना डिफ़ॉल्ट मान 5 ले लेगा और दोनों जुड़कर 3 + 5 = 8 रिटर्न करेंगे।

Q. 68. कौन सा स्ट्रिंग मेथड किसी स्ट्रिंग के दोनों सिरों (आगे और पीछे दोनों तरफ) से अतिरिक्त व्हाइटस्पेस (खाली जगह) को हटा देता है?
Which function/method removes whitespace from both ends (leading and trailing) of a string?
(A) strip()
(B) lstrip()
(C) rstrip()
(D) trim()
Correct Answer: (A) strip()
Explanation: strip() मेथड स्ट्रिंग के बाएं (Leading) और दाएं (Trailing) दोनों किनारों से फालतू स्पेस को हटा देता है।

Q. 69. जब नीचे दिया गया Python कोड चलाया जाता है तो क्या होता है?
What happens when this Python code is executed?
f = open(“data.txt”, “r”)
f.write(“Hello”)
f.close()
(A) “Hello” is written at the beginning of the file
(B) “Hello” is appended at the end of the file
(C) Raises an exception (io.UnsupportedOperation: not writable)
(D) The file is deleted
Correct Answer: (C) Raises an exception (io.UnsupportedOperation: not writable)
Explanation: चूंकि फाइल को केवल पढ़ने के मोड (‘r’ – Read only mode) में खोला गया है, इसलिए उसमें f.write() से लिखने की कोशिश करने पर रनटाइम एक्सेप्शन (UnsupportedOperation एरर) आता है।

Q. 70. निम्नलिखित Python कोड का आउटपुट क्या होगा?
What will be the output of the following Python code?
i = 1
while i < 4:
print(i, end=” “)
i += 1
else:
print(“Done”)
(A) 1 2 3
(B) 1 2 3 4 Done
(C) Done
(D) 1 2 3 Done
Correct Answer: (D) 1 2 3 Done
Explanation: while लूप i = 1, 2, 3 के लिए चलेगा और बिना किसी break के सामान्य रूप से समाप्त होने पर उसका else ब्लॉक भी चलेगा, जिससे ‘1 2 3 Done’ प्रिंट होगा।

Q. 71. Python फाइल हैंडलिंग में बिना किसी आर्गुमेंट के f.read() मेथड क्या कार्य करता है?
What does f.read() (without arguments) do in Python file handling?
(A) Reads only the first character
(B) Reads only the first line
(C) Reads the entire file content as a single string
(D) Deletes the file content
Correct Answer: (C) Reads the entire file content as a single string
Explanation: जब read() मेथड में कोई संख्या पास नहीं की जाती, तो वह पूरी फाइल के कंटेंट को अंत (EOF) तक पढ़कर एक सिंगल स्ट्रिंग के रूप में लौटाता है।

Q. 72. निम्नलिखित Python एक्सप्रेशन का आउटपुट क्या होगा?
What is the output of the following Python expression?
print((1 < 2 < 3) == True)
(A) True (if parenthesized) / False (if written as 1 < 2 < 3 == True without parentheses due to chained comparison)
(B) False (for print(1 < 2 < 3 == True))
(C) SyntaxError
(D) None
Correct Answer: (B) False (for print(1 < 2 < 3 == True))
Explanation: बिना ब्रैकेट के print(1 < 2 < 3 == True) लिखने पर Python चेन्ड कंपैरिजन (1 < 2) and (2 < 3) and (3 == True) करता है; चूंकि 3 == True गलत (False) है, इसलिए आउटपुट False आता है।

Q. 73. किसी वर्ग मैट्रिक्स के अपर ट्रायंगुलर मैट्रिक्स (Upper Triangular Matrix) के एलिमेंट्स को प्रिंट करने वाले फ्लोचार्ट/प्रोग्राम में रो इंडेक्स i और कॉलम इंडेक्स j के बीच कौन सी कंडीशन चेक की जाती है?
In the flowchart to print elements of an upper triangular matrix, which condition between row index i and column index j is checked?
(A) i > j
(B) i <= j
(C) i == -1
(D) i + j == 0
Correct Answer: (B) i <= j
Explanation: अपर ट्रायंगुलर मैट्रिक्स में मुख्य विकर्ण (Diagonal) और उसके ऊपर के सभी एलिमेंट्स शामिल होते हैं, जहाँ हमेशा पंक्ति संख्या (Row i) स्तंभ संख्या (Column j) के बराबर या उससे छोटी (i <= j) होती है।

Q. 74. निम्नलिखित Python कोड का आउटपुट क्या होगा?
What is the output of the following Python code?
for i in range(5):
if i == 3:
continue
print(i, end=” “)
(A) 0 1 2 3 4
(B) 0 1 2 4
(C) 0 1 2
(D) 3
Correct Answer: (B) 0 1 2 4
Explanation: range(5) से 0 से 4 तक संख्याएं चलेंगी, लेकिन जब i == 3 होगा तब continue स्टेटमेंट केवल 3 को स्किप कर देगा और बाकी 0 1 2 4 प्रिंट हो जाएंगे।

Q. 75. निम्नलिखित Python कोड का आउटपुट क्या होगा?
What is the output of the following Python code?
def show(a, b):
print(a, b)
show(b=2, a=1)
(A) 2 1
(B) 1 2
(C) a b
(D) Error
Correct Answer: (B) 1 2
Explanation: कीवर्ड आर्गुमेंट्स show(b=2, a=1) का उपयोग करने पर क्रम कोई भी हो, a में 1 और b में 2 ही जाएगा; इसलिए print(a, b) से 1 2 प्रिंट होगा।

Q. 76. निम्नलिखित Python कोड का आउटपुट क्या होगा?
What will be the output of the following Python code?
for i in range(1, 5):
if i == 3:
break
print(i, end=” “)
(A) 1 2 3 4
(B) 1 2 3
(C) 3 4
(D) 1 2
Correct Answer: (D) 1 2
Explanation: लूप 1 और 2 को प्रिंट करेगा, और जैसे ही i == 3 होगा, break स्टेटमेंट लूप को तुरंत समाप्त कर देगा जिससे केवल 1 2 आउटपुट मिलेगा।

Q. 77. Python में किसी नाम या वेरिएबल के ‘Scope’ का क्या अर्थ होता है?
The ‘Scope’ of a name in Python refers to ______.
(A) The total memory in gigabytes
(B) The region of code where a name/variable is directly accessible and recognized
(C) The font size of variable names in IDE
(D) The number of characters in the variable name
Correct Answer: (B) The region of code where a name/variable is directly accessible and recognized
Explanation: प्रोग्राम कोड का वह हिस्सा या क्षेत्र जहाँ किसी वेरिएबल या फंक्शन नाम को सीधे पहचाना और एक्सेस किया जा सकता है, उसका स्कोप (Scope) कहलाता है।

Q. 78. जब किसी Python प्रोग्राम को निष्पादित (Execute) किया जाता है, तो इंटरप्रेटर द्वारा सबसे पहले कौन सा आंतरिक चरण पूरा किया जाता है?
When a Python program is executed, which step occurs first internally?
(A) Printing output on printer
(B) Lexical and Syntax Analysis (Parsing source code to check syntax before bytecode generation)
(C) Deleting temporary folders
(D) Closing the terminal
Correct Answer: (B) Lexical and Syntax Analysis (Parsing source code to check syntax before bytecode generation)
Explanation: Python कोड रन करते समय सबसे पहले सोर्स कोड का सिंटैक्स विश्लेषण (Syntax Analysis / Parsing) होता है और सही होने पर ही वह बाइटकोड में बदलकर निष्पादित होता है।

Q. 79. निम्नलिखित Python कोड द्वारा क्या आउटपुट जनरेट किया जा सकता है?
What can be the output of the following Python code?
import random
print(random.choice(“FUN”))
(A) Always “FUN”
(B) Always “F”
(C) Always an integer
(D) Any one character from ‘F’, ‘U’, or ‘N’
Correct Answer: (D) Any one character from ‘F’, ‘U’, or ‘N’
Explanation: random.choice("FUN") दी गई स्ट्रिंग "FUN" में से रैंडम रूप से कोई भी एक अक्षर ('F', 'U' या 'N') चुनकर प्रिंट करता है।

Q. 80. निम्नलिखित Python कोड का आउटपुट क्या होगा?
What is the output of the following Python code?
x = 5
def f():
x = 10
f()
print(x)
(A) 10
(B) 5
(C) 15
(D) Error
Correct Answer: (B) 5
Explanation: फंक्शन f() के अंदर बिना global कीवर्ड के लिखा गया x = 10 एक अलग लोकल वेरिएबल बनाता है, जिससे बाहर मौजूद ग्लोबल वेरिएबल x का मान 5 ही बना रहता है।

Q. 81. नेस्टेड फंक्शन के अंदर प्रयुक्त nonlocal कीवर्ड किस स्कोप के वेरिएबल को संदर्भित करता है?
What does the nonlocal keyword refer to in Python?
(A) Variable in the nearest enclosing (outer) function scope
(B) Variable in the built-in module
(C) Hardware register variable
(D) Command-line argument
Correct Answer: (A) Variable in the nearest enclosing (outer) function scope
Explanation: नेस्टेड (इनर) फंक्शन के अंदर से अपने ठीक बाहर वाले फंक्शन (Enclosing function scope) के वेरिएबल को मॉडिफाई करने के लिए nonlocal कीवर्ड का उपयोग किया जाता है।

Q. 82. Python में किसी सीक्वेंस (लिस्ट, टपल, स्ट्रिंग) में किसी एलिमेंट की उपस्थिति जांचने वाला मेंबरशिप ऑपरेटर (Membership Operator) कौन सा है?
Which operator checks membership in Python?
(A) is
(B) &
(C) ==
(D) in (and not in)
Correct Answer: (D) in (and not in)
Explanation: किसी स्ट्रिंग, लिस्ट या टपल के अंदर कोई मान मौजूद है या नहीं, यह जांचने के लिए मेंबरशिप ऑपरेटर in (और not in) का प्रयोग होता है।

Q. 83. जब लूप शुरू करने से पहले ही इटरेशन (दोहराव) की कुल संख्या पहले से पता हो, तो कौन सा लूप सबसे उपयुक्त माना जाता है?
Which loop is preferred when the number of iterations is known in advance?
(A) infinite while loop
(B) try-except block
(C) for loop
(D) switch block
Correct Answer: (C) for loop
Explanation: जब यह पहले से ज्ञात हो कि लूप को कितनी बार चलाना है (Definite iteration), तब for लूप का उपयोग किया जाता है।

Q. 84. Python फंक्शन में डिफ़ॉल्ट आर्गुमेंट वैल्यूज़ (Default argument values) को कब इवैल्यूएट किया जाता है?
Default argument values in a Python function are evaluated ______.
(A) Once, at the time of function definition (def)
(B) Only when the program exits
(C) Only when a SyntaxError occurs
(D) Never evaluated
Correct Answer: (A) Once, at the time of function definition (def)
Explanation: Python में फंक्शन के डिफ़ॉल्ट पैरामीटर मान (जैसे def func(a=10):) फंक्शन को हर बार कॉल करते समय नहीं, बल्कि फंक्शन परिभाषित (def) होते समय केवल एक बार इवैल्यूएट होते हैं।

Q. 85. निम्नलिखित Python कोड का आउटपुट क्या होगा?
What is the output of the following Python code?
i = 0
while i < 3:
i += 1
if i == 2:
continue
print(i, end=” “)
else:
print(“End”)
(A) 1 2 3 End
(B) 0 1 2 End
(C) 1 2
(D) 1 3 End
Correct Answer: (D) 1 3 End
Explanation: लूप में i बढ़कर 1, 2 और 3 होगा; i == 2 पर continue होने से 2 प्रिंट नहीं होगा, इसलिए 1 और 3 प्रिंट होने के बाद अंत में else ब्लॉक का End प्रिंट होगा (1 3 End)।

Q. 86. निम्नलिखित Python कोड क्या कार्य करता है?
What does the following Python code do?
from datetime import datetime
dt = datetime.strptime(“2024-11-02”, “%Y-%m-%d”)
print(dt.date())
(A) Deletes the system calendar
(B) Converts the date string "2024-11-02" into a datetime / date object and prints the date
(C) Raises a ZeroDivisionError
(D) Prints only the current time in seconds
Correct Answer: (B) Converts the date string "2024-11-02" into a datetime / date object and prints the date
Explanation: datetime.strptime() मेथड स्ट्रिंग रूप में लिखी गई तारीख को दिए गए फॉर्मेट ("%Y-%m-%d") के अनुसार पार्स करके datetime ऑब्जेक्ट में बदल देता है।

Q. 87. किसी 1D NumPy एरे या लिस्ट पर arr[::-1] स्लाइसिंग करने से क्या होता है?
What does arr[::-1] do on a 1D array or list?
(A) Deletes all elements of the array
(B) Reverses the array (एरे के एलिमेंट्स का क्रम उलट देता है)
(C) Sorts the array in ascending order
(D) Multiplies every element by -1
Correct Answer: (B) Reverses the array (एरे के एलिमेंट्स का क्रम उलट देता है)
Explanation: स्लाइसिंग arr[::-1] में स्टेप -1 होने से एरे के सभी एलिमेंट्स अंतिम से पहले क्रम में उलट (Reverse हो) जाते हैं।

Q. 88. NumPy में किसी मौजूदा एरे के एलिमेंट्स का डेटा टाइप बदलने (जैसे float से int करने) के लिए किस मेथड का उपयोग किया जाता है?
Which method changes the data type of a NumPy array?
(A) astype()
(B) reshape()
(C) arange()
(D) append()
Correct Answer: (A) astype()
Explanation: NumPy एरे को किसी नए डेटा टाइप में कास्ट करके नया एरे प्राप्त करने के लिए arr.astype(new_dtype) मेथड का उपयोग किया जाता है।

Q. 89. NumPy में np.ones((2, 3)) फंक्शन क्या बनाता है?
What does np.ones((2, 3)) create in NumPy?
(A) A 2D array with 2 rows and 3 columns filled with 1s (1.0)
(B) A 1D array with only two elements 2 and 3
(C) A 3D array filled with zeros
(D) An identity matrix of size 6×6
Correct Answer: (A) A 2D array with 2 rows and 3 columns filled with 1s (1.0)
Explanation: np.ones((2, 3)) 2 पंक्तियों (Rows) और 3 स्तंभों (Columns) वाला एक 2D एरे बनाता है जिसके सभी 6 एलिमेंट्स का मान 1. (वन) होता है।

Q. 90. एल्गोरिदम का कौन सा गुण यह सुनिश्चित करता है कि एल्गोरिदम अनंत काल तक न चले और सीमित चरणों के बाद निश्चित रूप से समाप्त हो जाए?
Which property of an algorithm ensures that it does not run indefinitely and terminates after a finite number of steps?
(A) Finiteness (सीमितता)
(B) Ambiguity
(C) Infinite recursion
(D) Hardware dependency
Correct Answer: (A) Finiteness (सीमितता)
Explanation: एल्गोरिदम का ‘Finiteness’ गुण यह सुनिश्चित करता है कि एल्गोरिदम के चरणों की संख्या सीमित हो और वह एक निश्चित समय में रुक जाए।

Q. 91. 64-बिट सिस्टम पर पूर्णांकों से बनाए गए NumPy एरे np.array([1, 2, 3]) का स्टैंडर्ड डेटा टाइप क्या होता है?
What is the default integer data type of np.array([1, 2, 3]) on a 64-bit Python system?
(A) float16
(B) complex128
(C) int64 (or int32 depending on 32/64-bit platform)
(D) bool
Correct Answer: (C) int64 (or int32 depending on 32/64-bit platform)
Explanation: पूर्णांक संख्याओं [1, 2, 3] से एरे बनाने पर उसका डिफ़ॉल्ट डेटा टाइप पूर्णांक (int64 / int32) होता है।

Q. 92. फ्लोचार्ट में डायमंड (Diamond / Rhombus) आकार के सिंबल का उपयोग किसे दर्शाने के लिए किया जाता है?
In a flowchart, a diamond-shaped symbol is used to represent ______.
(A) Start / Stop
(B) Input / Output
(C) Decision Making / Condition Check (Yes/No or True/False)
(D) Simple Arithmetic Assignment
Correct Answer: (C) Decision Making / Condition Check (Yes/No or True/False)
Explanation: फ्लोचार्ट में किसी भी कंडीशन की जांच या निर्णय (Decision Making) को दिखाने के लिए डायमंड (हीरे के आकार) सिंबल का प्रयोग होता है।

Q. 93. निम्नलिखित में से कौन सा ऑपरेशन Python टपल (Tuple) पर मान्य नहीं है (अर्थात एरर देगा)?
Which operation is NOT valid on a Tuple in Python?
(A) Indexing (t[0])
(B) Slicing (t[1:3])
(C) Concatenation (t1 + t2)
(D) Element Assignment (t[0] = 99)
Correct Answer: (D) Element Assignment (t[0] = 99)
Explanation: चूंकि टपल इम्यूटेबल होता है, इसलिए उसके किसी इंडेक्स पर नया मान असाइन करना (t[0] = 99) अवैध है और TypeError देता है।

Q. 94. निम्नलिखित Python कोड का आउटपुट क्या होगा?
What is the output of the following Python code?
x = 10
print(x + (x > 5))
(A) 10
(B) 15
(C) True
(D) 11
Correct Answer: (D) 11
Explanation: शर्त (x > 5) यानी 10 > 5 सत्य (True) है, और अंकगणितीय जोड़ में True का मान 1 होता है; इसलिए 10 + 1 = 11 प्रिंट होगा।

Q. 95. Python में यूजर से इनपुट लेने वाला input() फंक्शन हमेशा किस डेटा टाइप में मान लौटाता है?
The input() function in Python always returns a value of which data type?
(A) int
(B) float
(C) list
(D) str (String)
Correct Answer: (D) str (String)
Explanation: input() फंक्शन में यूजर चाहे अंक टाइप करे या अक्षर, वह उसे हमेशा स्ट्रिंग (str) के रूप में ही रिटर्न करता है।

Q. 96. एक Python मॉड्यूल (Module) क्या होता है?
A Python module is ______.
(A) A hardware chip inside the CPU
(B) An operating system kernel
(C) A flowchart drawing tool
(D) A .py file containing Python definitions, functions, classes, and statements
Correct Answer: (D) A .py file containing Python definitions, functions, classes, and statements
Explanation: Python कोड (फंक्शन्स, क्लासेस और वेरिएबल्स) से युक्त किसी भी .py फाइल को Python मॉड्यूल कहा जाता है, जिसे दूसरे प्रोग्राम्स में import किया जा सकता है।

Q. 97. NumPy एरे का कौन सा एट्रिब्यूट एरे के प्रत्येक एलिमेंट द्वारा ली जाने वाली मेमोरी बाइट्स की संख्या (Bytes per element) को वापस करता है?
Which attribute of a NumPy array returns the number of bytes per element?
(A) itemsize
(B) size
(C) ndim
(D) shape
Correct Answer: (A) itemsize
Explanation: NumPy में ndarray.itemsize एट्रिब्यूट एरे के एक सिंगल एलिमेंट का मेमोरी साइज बाइट्स में बताता है (जैसे int32 के लिए 4 बाइट्स और int64 के लिए 8 बाइट्स)।

Q. 98. टेलर श्रेणी विस्तार (Series Expansion) का उपयोग करके $\sin(x)$ का मान निकालने वाला एल्गोरिदम मुख्य रूप से किसका उपयोग करता है?
The algorithm to evaluate $\sin(x)$ using series expansion primarily uses ______.
(A) Iteration (looping) and sequential arithmetic updates of terms
(B) Database sorting only
(C) File deletion operations
(D) Hardware interrupts only
Correct Answer: (A) Iteration (looping) and sequential arithmetic updates of terms
Explanation: $\sin(x) = x – x^3/3! + x^5/5! – \dots$ श्रेणी का मान निकालने के लिए लूप (Iteration) और क्रमिक अंकगणितीय गणना (Sequential arithmetic) का उपयोग करके पदों को जोड़ा जाता है।

Q. 99. एक अच्छी तरह से डिजाइन किए गए एल्गोरिदम (Well-designed Algorithm) को किन शर्तों को पूरा करना चाहिए?
A well-designed algorithm must satisfy ______.
(A) Ambiguity and Infinite execution
(B) Hardware dependency only
(C) Correctness, Finiteness, and Clarity (Unambiguity)
(D) High memory wastage
Correct Answer: (C) Correctness, Finiteness, and Clarity (Unambiguity)
Explanation: एक आदर्श एल्गोरिदम हमेशा सही परिणाम देने वाला (Correctness), सीमित चरणों में रुकने वाला (Finiteness) और पूरी तरह से स्पष्ट व निर्विवाद (Clarity/Definiteness) होना चाहिए।

Q. 100. निम्नलिखित Python कोड का आउटपुट क्या होगा?
What is the output of the following Python code?
for i in range(3):
pass
print(i)
(A) 0
(B) 1
(C) 2
(D) 3
Correct Answer: (C) 2
Explanation: range(3) लूप को i = 0, 1 और 2 के लिए चलाएगा; pass कुछ नहीं करेगा लेकिन लूप पूरा चलने के बाद i में अंतिम मान 2 स्टोर रहेगा, इसलिए बाहर print(i) करने पर 2 प्रिंट होगा।


SET- 2

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 के रूप में इस्तेमाल किया जा सकता है।

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 मोड में निष्क्रिय हो जाता है, लेकिन यह लूप तोड़ने का टूल नहीं है।

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 प्राप्त होगा।

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)।

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] दोनों जुड़ चुके होते हैं।

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) लौटाता है।

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 में।

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() क्रमशः लोकल व ग्लोबल सिंबल टेबल डिक्शनरी लौटाते हैं।

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 का ऐरे है, तो नई कॉपी नहीं बनाता।

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 दोनों पर समान रूप से काम करता है।

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 के लिए होता है।

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) गलत है।

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 देता है।

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 का उदाहरण है।

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) हैं।

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) प्रक्रियाएं हैं।

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() तत्वों को जोड़ता है।

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,) लौटाता है।

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) और कमेंट्स लिखने से कोड को समझना और भविष्य में उसे अपडेट या मेंटेन करना आसान हो जाता है।

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 केवल वर्तमान इटरेशन को स्किप करता है।

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 देता है।

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) के रूप में संग्रहीत होती है।

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) बनाता है।

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 होता है)।

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 करने पर नामों का टकराव नहीं होता।

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') में फ़ाइल खोलता है।

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})।

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 मिलता है)।

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 (इंटरप्रेटर इंजन) लाइन-दर-लाइन निष्पादित करता है, इसीलिए इसे इंटरप्रेटेड भाषा कहा जाता है।

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 स्टेटमेंट लूप को तुरंत समाप्त कर देगा।

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() समान अंतराल वाले बिंदुओं की संख्या के आधार पर ऐरे बनाता है।

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) नहीं जोड़ता है।

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) हैं।

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) होती है।

यहाँ 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] स्क्रिप्ट का नाम होता है।

Hope aapne M3-R5 O Level NIELIT July 2026 ke previous papers padh liye hain aur samajh bhi liya hai.

आज तक के सभी ओ-लेवल प्रीवियस पेपर्स को पढ़ना, डाउनलोड करना या मॉक टेस्ट देना है तो नीचे दिए गए बटन को दबाइये!


Kya aap M3-R5 O Level July 2026 ke previous papers ka mock test dena chahte hain?, Neeche diye gaye button par click karein.


Agar aap M3-R5 O Level July 2026 ke previous papers PDF mein download karna chahte hain?, to neeche diye gaye button par click karein.


Apna study experience humse neeche comment box mein zarur share karein. Agar aapko koi galti mile to humein batana na bhoolen. 😊

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

error: Content is protected !!
Scroll to Top