top of page

Python July 2026 Exam Paper

18 hours ago
11 min read

1. निम्नलिखित में से किस प्रॉब्लम में पुनरावृत्ति प्रक्रिया की आवश्यकता होती है ?

a. फैक्टोरियल गणना

b. संख्याओं का योग

c. डेसिमल को बाइनरी में बदलना

d. दो वेरिएबलों का आदान-प्रदान

(A) केवल a, b, c (B) केवल a, c, d (C) केवल b और d (D) केवल a और c


Which of the following problems requires iterative processing ?

a. Factorial computation

b. Summation of numbers

c. Decimal to Binary conversion

d. Exchanging two variables

(A) a, b, c only (B) a, c, d only (C) b and d only (D) a and c only

Ans: A


2. कौन सा पायथन कॉन्स्टेंट ऐसी वैल्यू को दिखाता है जो किसी वैल्यू के न होने का संकेत देती है ?

(A) एम्प्टी स्ट्रिंग (B) फाल्स (C) 0 (D) इनमें से कोई नहीं


Which Python constant represents a value that indicates absence of a value ?

(A) Empty string (B) False (C) 0 (D) None

Ans: D


3. अभिकथन A : फैक्टोरियल गणना में रिकर्शन, आइटरेशन की तुलना में कम मेमोरी-कुशल होता है।

कारण R : रिकर्शन इंटरमीडिएट परिणामों को फंक्शन कॉल स्टैक पर स्टोर करता है।

(A) A गलत, R सही

(B) A सही, R गलत

(C) A और R सही, R, A का सही स्पष्टीकरण नहीं है

(D) A और R सही, R, A की व्याख्या करता है


Assertion A : In factorial computation, recursion is less memory-efficient than iteration.

Reason R : Recursion stores intermediate results on the function call stack.

(A) A false, R true

(B) A true, R false

(C) A and R true, R is not correct explanation of A

(D) A and R true, R explains A

Ans: D


4. फ्लोचार्ट में निर्णय लेने के लिए प्रयुक्त प्रतीक है :

(A) आयत (B) समांतर चतुर्भुज (C) डायमंड (D) अंडाकार


The symbol used for decision-making in a flowchart is :

(A) Rectangle (B) Parallelogram (C) Diamond (D) Oval

Ans: C

5. नीचे दिए गए पायथन कोड पर विचार करें। y का अंतिम मान क्या होगा ?

Consider following Python code. What will be the final value of y ?

x, y = 5, 0

while x > 0:

x -= 1

if x == 2: continue

y += x

(A) 8 (B) 9 (C) 10 (D) 11

Ans: A


6. पायथन फंक्शन्स से जुड़े इन स्टेटमेंट्स को True (T) या False (F) के तौर पर मार्क करें :

1. eval() फंक्शन एक स्ट्रिंग को पायथन कोड में बदलता है और उसे एक्जीक्यूट करता है।

2. strip() स्ट्रिंग के सिर्फ बाएँ ओर से कैरेक्टर्स को हटाता है।

3. isdigit() True रिटर्न करता है अगर सभी कैरेक्टर्स डिजिट्स हों।

4. random() 0 और 1 के बीच एक इंटीजर रिटर्न करता है।


Mark the following statements pertaining to Python functions as True (T) or False (F) :

1. eval() function converts a string into Python code and executes it.

2. strip() removes characters only from the left side of a string.

3. isdigit() returns True if all characters are digits.

4. random() returns an integer between 0 and 1.


(A) 1-T, 2-T, 3-T, 4-T

(B) 1-F, 2-F, 3-T, 4-F

(C) 1-T, 2-F, 3-F, 4-T

(D) 1-T, 2-F, 3-T, 4-F

Ans: D


7. जब किसी मौजूदा फ़ाइल को "w+" मोड में खोला जाता है, तो क्या होता है ?

(A) फ़ाइल को बिना ट्रंकेशन के केवल रीडिंग के लिए खोला जाता है

(B) फ़ाइल को केवल राइटिंग के लिए खोला जाता है और डेटा को अपेंड किया जाता है

(C) फ़ाइल को रीड और राइट करने के लिए खोला जाता है, और मौजूदा कंटेंट को इरेज़ कर दिया जाता है

(D) फ़ाइल को अपेंड करने और रीडिंग के लिए खोला जाता है


What happens when an existing file is opened in "w+" mode ?

(A) File is opened for reading only without truncation

(B) File is opened for writing only and data is appended

(C) File is opened for reading and writing, and existing content is erased

(D) File is opened for appending and reading

Ans: C

8. अगर कोई वेरिएबल लोकल, एनक्लोजिंग या ग्लोबल स्कोप में नहीं मिलता है, तो पायथन ____ में ढूंढता है।

(A) सिर्फ लोकल स्कोप में दोबारा

(B) एनक्लोजिंग स्कोप में दोबारा

(C) बिल्ट-इन स्कोप में

(D) मॉड्यूल नेमस्पेस में


If a variable is not found in Local, Enclosing, or Global scopes, Python searches :

(A) Only the Local scope again

(B) The Enclosing scope again

(C) The Built-in scope

(D) The module namespace

Ans: C

9. नीचे दिए गए कोड का आउटपुट क्या होगा?

a = [1, 2, 3]

b = a

a.append(4)

print(b)

(A) कोई नहीं (B)[1,2,3] (C) एरर (D)[1,2,3,4]

Ans: D


What will be the output of the code below?

a = [1, 2, 3]

b = a

a.append(4)

print(b)

(A) None (B)[1,2,3 (C) Error (D)[1,2,3,4]

Ans:D


10. संख्या 25 को डेसिमल से बाइनरी में बदलने के लिए, कौन-सा बाइनरी निरूपण सही है?

For decimal-to-binary conversion of number 25, which binary representation is correct?

(A) 11001 (B) 10011 (C) 10101 (D) 11100

Ans: A


11. पायथन में, एक डायनामिक लिस्ट में n एलिमेंट्स को अपेंड करने की स्पेस कॉम्प्लेक्सिटी क्या है?

In Python, what is the space complexity of appending n elements into a dynamic list?

(A) O(n log n) (B) O(n) (C) O(1) (D) O(log n)

Ans: B


12. पायथन में, सॉर्ट किए गए ऐरे के लिए कौन सा सर्चिंग एल्गोरिदम उपयुक्त है?

(A) लीनियर सर्च (B) हैश सर्च (C) जंप सर्च (D) बाइनरी सर्च


In Python, which searching algorithm is suitable for sorted arrays?

(A) Linear Search (B) Hash Search (C) Jump Search (D) Binary Search

Ans: D


13. पायथन में एलिमेंट एक्सेस के लिए इनमें से किसकी औसत-केस टाइम कॉम्प्लेक्सिटी O(1) है?

(A) डिक्शनरी (B) ट्यूपल (C) सेट (D) लिस्ट


Which of the following has the average-case time complexity of O(1) for element access in Python?

(A) Dictionary (B) Tuple (C) Set (D) List

Ans: A

14. नीचे दिए गए पायथन फ़ंक्शन पर विचार करें :

def fact(n):

if n == 0:

return 1

else:

return n * fact(n-1)

इनमें से कौन सा सही है ?

1. n >= 0 के लिए, फ़ंक्शन हमेशा समाप्त होता है।

2. बहुत बड़े n के लिए, रिकर्शन डेप्थ एरर हो सकता है।

3. नेगेटिव n के लिए, फ़ंक्शन इनफिनिट रिकर्शन में चला जाता है।

4. इसके बराबर का आइटरेटिव सॉल्यूशन रिकर्शन डेप्थ की समस्या से बचाता है।

(A) केवल 1, 2, 3 (B) केवल 2, 3, 4 (C) केवल 1, 4 (D) 1, 2, 3, 4


Consider the following Python function :

def fact(n):

if n == 0:

return 1

else:

return n * fact(n-1)

Which of the following is correct ?

1. The function always terminates for n >= 0.

2. For very large n, recursion depth error may occur.

3. For negative n, function goes into infinite recursion.

4. Equivalent iterative solution avoids recursion depth issue.

(A) 1, 2, 3 only (B) 2, 3, 4 only (C) 1, 4 only (D) 1, 2, 3, 4

Ans: D


15. नीचे दिए गए प्रश्न में एक अभिकथन A और एक कारण R शामिल है। आपको दिए गए विकल्पों में से सही विकल्प चुनना है।

अभिकथन A : फ्लोचार्ट किसी एल्गोरिदम के लॉजिक को विजुअलाइज करने में मदद करते हैं।

कारण R : फ्लोचार्ट प्रोग्रामों के मशीन-निष्पादन योग्य निरूपण होते हैं।

(A) A और R सही हैं, R सही स्पष्टीकरण है

(B) A और R सही हैं, R सही स्पष्टीकरण नहीं है

(C) A सही है, R गलत है

(D) A गलत है, R सही है


The following question consists of an Assertion A and a Reason R. You need to choose the correct option from the given options.

Assertion A : Flowcharts help visualize the logic of an algorithm.

Reason R : Flowcharts are machine-executable representations of programs.

(A) A and R true, R correct explanation

(B) A and R true, R not correct explanation

(C) A true, R false

(D) A false, R true

Ans: C

16. अगर कोई वेरिएबल नेम लोकल, एनक्लोजिंग और ग्लोबल स्कोप में मौजूद हो, तो किसे चुना जाता है ?

(A) ग्लोबल (B) एनक्लोजिंग (C) बिल्ट-इन (D) लोकल


If a variable name exists in local, enclosing, and global scopes, which one is chosen ?

(A) Global (B) Enclosing (C) Built-in (D) Local

Ans: D


17. एक प्रोग्रामर एक ऐसा एल्गोरिदम बनाना चाहता है जो यह जांच सके कि कोई संख्या अभाज्य है या नहीं। वे इसे 2 से n - 1 तक सभी पूर्णांकों से संख्या को विभाजित करके लागू करते हैं। n = 9973 के लिए, प्रोग्राम को चलने में बहुत समय लगता है। कौन-सा ऑप्टिमाइजेशन लागू किया जाना चाहिए ?

(A) केवल sqrt(n) तक विभाजित करें।

(B) केवल विषम संख्याओं से विभाजित करें।

(C) रिकर्सिव फैक्टोरियल-आधारित जांच का उपयोग करें।

(D) भाजकों पर बाइनरी सर्च का उपयोग करें।


A programmer wants to create an algorithm that checks if a number is prime. They implement it by dividing the number by all integers from 2 to n - 1. For n = 9973, the program takes a long time to run. Which optimization should be applied ?

(A) Divide only up to sqrt(n).

(B) Divide only by odd numbers.

(C) Use a recursive factorial-based check.

(D) Use binary search on divisors.

Ans: A


18. पायथन में फॉर लूप के बारे में इनमें से कौन-से कथन सही हैं ?

1. ये लिस्ट, स्ट्रिंग और रेंज पर इटरेट कर सकते हैं।

2. इनमें हमेशा एक एल्स शामिल होना चाहिए।

3. ब्रेक अगले इटरेशन पर चला जाता है।

4. एल्स तभी चलता है जब लूप ब्रेक से खत्म न हो।

(A) केवल 1 और 2 (B) केवल 3 और 4 (C) केवल 1 और 4 (D) केवल 2 और 3


Which of the following statements are true about for loops in Python ?

1. They can iterate over lists, strings, and ranges.

2. They must always include an else.

3. break skips to the next iteration.

4. else executes only if the loop is not terminated by break.

(A) 1 and 2 only (B) 3 and 4 only (C) 1 and 4 only (D) 2 and 3 only

Ans: C

19. पायथन में रिकर्शन के बारे में कौन से कथन सही हैं?

1. रिकर्शन की गहराई डिफ़ॉल्ट रूप से सीमित होती है।

2. पायथन द्वारा टेल रिकर्शन को अपने आप ऑप्टिमाइज़ किया जाता है।

3. http://sys.setrecursionlimit() रिकर्शन की गहराई को बढ़ा सकता है।

4. रिकर्सिव फंक्शन्स को उनके जैसे काम करने वाले इटरेटिव फंक्शंस से बदला जा सकता है।

(A) 1, 2, 3, 4 (B) केवल 1, 2, 3 (C) केवल 1, 3, 4 (D) केवल 2, 4


Which statements about recursion in Python are true?

1. Recursion depth is limited by default.

2. Tail recursion is optimized by Python automatically.

3. http://sys.setrecursionlimit() can increase recursion depth.

4. Recursive functions can be replaced by iterative equivalents.

(A) 1, 2, 3, 4 (B) 1, 2, 3 only (C) 1, 3, 4 only (D) 2, 4 only

Ans: C


20. इनमें से कौन सा कथन गलत है?

(A) मॉड्यूल एक ऐसी फ़ाइल है जिसमें पायथन डेफिनिशन और स्टेटमेंट होते हैं।

(B) जब किसी मॉड्यूल को इम्पोर्ट किया जाता है, तो pycache में एक कम्पाइल की गई .pyc फ़ाइल बन सकती है।

(C) हर मॉड्यूल का अपना ग्लोबल नेमस्पेस होता है।

(D) किसी मॉड्यूल के अंदर ग्लोबल के तौर पर घोषित वेरिएबल, उसे इम्पोर्ट करने वाले दूसरे मॉड्यूल में अपने आप ग्लोबल बन जाता है।


Which of the following statements is FALSE?

(A) A module is a file containing Python definitions and statements.

(B) When a module is imported, a compiled .pyc file may be created in pycache.

(C) Each module has its own global namespace.

(D) A variable declared global inside a module automatically becomes global in another module that imports it.

Ans: D


21. पायथन से जुड़े इन वाक्यों को सही (T) या गलत (F) के तौर पर चिह्नित करें:

1. tell() फंक्शन बाइट्स में फ़ाइल पॉइंटर की मौजूदा पॉज़िशन बताता है।

2. seek(0) पॉइंटर को फ़ाइल के अंत में ले जाता है।

3. अगर फ़ाइल को "w" मोड में खोला जाए, तो write() फ़ाइल के कंटेंट को ओवरराइट कर देता है।

4. "a" मोड में खोली गई फ़ाइलें मौजूदा कंटेंट को ट्रंकेट कर देती हैं।


Mark following statements related to Python as True (T) or False (F):

1. tell() function returns the current file pointer position in bytes.

2. seek(0) moves the pointer to the end of the file.

3. write() overwrites the content of a file if opened in "w" mode.

4. Files opened in "a" mode truncate existing content.

(A) 1-T, 2-T, 3-T, 4-T (B) 1-F, 2-T, 3-T, 4-F

(C) 1-T, 2-F, 3-T, 4-F (D) 1-T, 2-F, 3-F, 4-T

Ans: C

22. फ़ाइल पॉइंटर की वर्तमान स्थिति को वापस पाने के लिए निम्नलिखित में से किस विधि का उपयोग किया जाता है?

Which of the following methods is used to return the current position of a file pointer?

(A) pointer() (B) tell() (C) seek() (D) position()

Ans: B

23. अभिकथन A : a = b = c = 5 तीनों वेरिएबल्स को 5 की वैल्यू देता है।

कारण R : Python कई असाइनमेंट्स को बाएँ से दाएँ इवैल्यूएट करता है।

(A) A और R दोनों सही हैं, R, A की सही व्याख्या करता है

(B) A और R दोनों सही हैं, R, A की सही व्याख्या नहीं करता है

(C) A सही है, R गलत है

(D) A गलत है, R सही है


Assertion A : a = b = c = 5 assigns the value 5 to all three variables.

Reason R : Python evaluates multiple assignments from left to right.

(A) A and R both true, R explains A

(B) A and R both true, R does not explain A

(C) A true, R false

(D) A false, R true

Ans: C


24. प्रोग्राम डेवलपमेंट का कौन-सा चरण लॉजिकल गलतियों को हटाकर उसकी सही होने की पुष्टि करता है?

(A) डॉक्यूमेंटेशन (B) कम्पाइलेशन (C) लिंकिंग (D) डीबगिंग

Which stage of program development ensures correctness by removing logical errors?

(A) Documentation (B) Compilation (C) Linking (D) Debugging

Ans: D


25. निम्नलिखित कोड का आउटपुट क्या होगा?

What is the output of the following code?

x = "Python"

print(x[1:4])

(A) yth (B) Pyt (C) hon (D) tho

Ans: A


26. निम्नलिखित में से कौन-से फ्लोचार्ट डिज़ाइन के मुख्य सिद्धांत हैं?

a. मानकीकृत प्रतीकों का उपयोग

b. स्पष्ट रूप से परिभाषित शुरुआत और अंत

c. किसी भी एल्गोरिदम में लूप से बचना

d. ऊपर से नीचे की ओर लॉजिकल फ्लो

(A) केवल a और b (B) केवल c और d

(C) केवल a, b और d (D) केवल a, b और c


Which of the following are key principles of flowchart design?

a. Use of standardized symbols

b. Clearly defined start and end

c. Avoid loops in any algorithm

d. Logical flow from top to bottom

(A) a and b only (B) c and d only

(C) a, b, and d only (D) a, b, and c only

Ans: C

27. इनमें से कौन सा कथन गलत है?

(A) मॉड्यूल नेमस्पेस केवल एक बार, उसके पहली बार इम्पोर्ट होने के समय बनाया जाता है।

(B) किसी मॉड्यूल को दोबारा इम्पोर्ट करने पर उसका कोड फिर से चलता है।

(C) http://importlib.reload() मॉड्यूल कोड को दोबारा चलाने के लिए फोर्स कर सकता है।

(D) एल.ई.जी.बी. नियम वेरिएबल लुकअप और फ़ंक्शन लुकअप, दोनों पर लागू होता है।


Which of the following statements is FALSE?

(A) A module namespace is created only once, at the time of its first import.

(B) Re-importing a module executes its code again.

(C) http://importlib.reload() can force re-execution of module code.

(D) The LEGB rule applies both to variable lookup and to function lookup.

Ans: B


28. अभिकथन A : पायथन में स्ट्रिंग्स इम्यूटेबल होती हैं।

कारण R : एक बार स्ट्रिंग बन जाने के बाद, उसके कैरेक्टर्स को सीधे बदला नहीं जा सकता।

(A) A गलत है, R सही है

(B) A सही है, R सही है, लेकिन R, A की व्याख्या नहीं करता है

(C) A सही है, R गलत है

(D) A सही है, R सही है, और R, A की व्याख्या करता है


Assertion A : Strings in Python are immutable.

Reason R : Once a string is created, its characters cannot be modified directly.

(A) A is false, R is true

(B) A is true, R is true, but R does not explain A

(C) A is true, R is false

(D) A is true, R is true, and R explains A

Ans: D


29. फास्ट फोरियर ट्रांसफॉर्म की गणना करने के लिए किस नंपी फ़ंक्शन का उपयोग किया जाता है?

Which NumPy function is used to compute the Fast Fourier Transform?

(A) http://np.fft.fft() (B) http://np.fft() (C) http://np.transform() (D) http://np.fourier()

Ans: A


30. पायथन फ़ंक्शंस के बारे में इनमें से कौन-सी बात सही नहीं है?

(A) फ़ंक्शंस को आर्ग्युमेंट्स के तौर पर पास नहीं किया जा सकता

(B) फ़ंक्शंस को नेस्ट किया जा सकता है

(C) फ़ंक्शंस, फ़ंक्शंस को रिटर्न कर सकते हैं

(D) फ़ंक्शंस फ़र्स्ट-क्लास ऑब्जेक्ट्स होते हैं


Which of the following is not true about Python functions?

(A) Functions cannot be passed as arguments

(B) Functions can be nested

(C) Functions can return functions

(D) Functions are first-class objects

Ans: A

 
 
 

Recent Posts

See All
NIELIT CCC MCQ Questions with Answers

Q1. Which protocol is used to upload and download file? (A) TCP (B) HTTP (C) FTP (D) SMTP Ans: C Q2. How many is Number of digits in a Visa Card number? (A) 15 (B) 16 (C) 18 (D) 19 Ans: B Q3. What is

 
 
 

Comments


bottom of page