O Level Python Model Paper 2025
अपवाद बढ़ाने के लिए पायथन में किस कीवर्ड का उपयोग किया जाता है?
What keyword is used in Python to raise exceptions?
Correct Answer: A) raise
पायथन प्रोग्रामिंग भाषा में कितने कीवर्ड मौजूद हैं?
How many keywords present in the python programming language?
There are 35 Python keywords as of Python 3.11.
Correct Answer: C) 33
पायथन किस भाषा में लिखा गया है?
In which language is Python written?
Python is implemented in C, which means the Python interpreter itself is written in the C programming language.
Correct Answer: B) C
पाइथन कितने कंट्रोल स्टेटमेंट को सपोर्ट करता है?
How many control statements python supports?
Python supports 3 control statements that help control the flow of execution in a program. These can be categorized as follows:
- break (Exits the nearest enclosing loop)
- continue (Skips the current iteration and moves to the next one)
- pass (A placeholder statement that does nothing; used for syntactical correctness)
Correct Answer: A) 3
पहचानकर्ताओं से निपटने के दौरान पाइथन केस संवेदनशील है?
Is Python case sensitive when dealing with identifiers?
Yes, Python is case sensitive when dealing with identifiers. This means that identifiers with different capitalization are treated as distinct.
Correct Answer: A) Yes
निम्नलिखित प्रोग्राम का आउटपुट क्या है:
What is the output of the following program:
print("Hello World"[::-1])
Let's break down the code:
print("Hello World"[::-1])
- The string
"Hello World"is being sliced using[::-1]. - The
[::-1]slice notation means "reverse the string."
So, the string "Hello World" reversed becomes "dlroW olleH".
Thus, the correct output is:
(A) dlroW olleH.
Correct Answer: A) dlroW olleH
पायथन में निम्नलिखित अभिव्यक्ति का परिणाम क्या होगा
What will be the result of the following expression in Python “2 ** 3 + 5 ** 2”?
Let's break down the expression:
2 ** 3 + 5 ** 2
-
Exponentiation first (since
**has higher precedence):2 ** 3 = 85 ** 2 = 25
-
Now, perform the addition:
8 + 25 = 33
So, the result is 33.
The correct answer is (B) 33.
Correct Answer: B) 33
नीचे दिए गए कोड स्निपेट में var का डेटाटाइप क्या होगा?
What will be the datatype of the var in the below code snippet?
var = 10
print(type(var))
var = "Hello"
print(type(var)) The variable var first holds an integer 10 (so its type is int), and then it holds a string "Hello" (so its type becomes str).
So, the answer is (D) int and str.
Correct Answer: D) int and str
नीचे दिए गए कोड स्निपेट में ___ क्या होगा?
What will be the output of the following code snippet?
a=[1,2,3,4,5,6,7,8,9]
a[::2]=10,20,30,40,50,60
print(a)
You are trying to replace 5 elements (from indices 0, 2, 4, 6, 8) with 6 new values. This causes a mismatch in size, resulting in a ValueError.
So, the answer is (A) ValueError: attempt to assign sequence of size 6 to extended slice of size 5.
Correct Answer: A) ValueError: attempt to assign sequence of size 6 to extended slice of size 5
निम्नलिखित सूची में फेरबदल करने के लिए सही कमांड क्या है?
What is the correct command to shuffle the following list?
fruit=['apple', 'banana', 'papaya', 'cherry'] To shuffle a list in Python, you need to use the shuffle function from the random module. The correct command is:
random.shuffle(fruit)
So, the correct answer is (C) random.shuffle(fruit).
Correct Answer: C) random.shuffle(fruit)
निम्नलिखित कोड का परिणाम क्या है:
What is the output of the following code:
L=[‘a’,’b’,’c’,’d’]
print ( “”.join(L)) The code snippet:
L = ['a', 'b', 'c', 'd']
print("".join(L))
- The
join()method is used to join elements of a list into a single string. - The
""before.join(L)means that there will be no separator between the elements of the list. - It will join the elements
'a','b','c', and'd'into the string"abcd".
So, the output is:
(C) abcd.
Correct Answer: C) abcd
निम्नलिखित प्रोग्राम का आउटपुट क्या है: (9//2)
What is the output of the code print
The code 9 // 2 uses the floor division operator //, which divides the number and rounds down to the nearest integer.
9 // 2results in4, as the division of 9 by 2 is 4.5, and floor division rounds it down to 4.
So, the correct answer is:
(C) 4.
Correct Answer: C) 4
निम्नलिखित प्रोग्राम का आउटपुट क्या है:
What is the output of the following program:
i = 0
while i < 3:
print (i)
i=i+1
print (i+1) The code prints two numbers in each loop iteration: the current value of i and i + 1.
- First,
i = 0→ prints0and2 - Then,
i = 1→ prints1and3 - Finally,
i = 2→ prints2and4
So, the output is 0 2 1 3 2 4.
The correct answer is (A) 0 2 1 3 2 4.
Correct Answer: A) 0 2 1 3 2 4
निम्नलिखित प्रोग्राम का आउटपुट क्या है:
What will be the output of the following Python code?
str1="helloworld"
str1[::-1] The code str1[::-1] reverses the string str1.
Explanation:
str1 = "helloworld"- The slice notation
[::-1]reverses the string.
So, "helloworld"[::-1] becomes "dlrowolleh".
The correct answer is:
(A) dlrowolleh.
Correct Answer: A) dlrowolleh
for i in range (-5,0,1) चलेगा
for i in range (-5,0,1) will run
Let's analyze the code:
for i in range(-5, 0, 1):
- The
range()function takes three arguments:start,stop, andstep.start = -5stop = 0(but 0 is not included in the range)step = 1
This means the loop will iterate over the values: -5, -4, -3, -2, -1.
So, the loop runs 5 times.
The correct answer is:
(B) 5 times.
Correct Answer: B) 5 times
निम्नलिखित आदेशों को क्रियान्वित करने पर, numpy में प्रसारण का उत्पादन होगा
On executing the following commands, Broadcasting in numpy will produce
a = np.array((0,10,20,30))
b = np.array((0,1,2))
y = a[:, None] + b The operation a[:, None] + b adds b (shape (3,)) to each element of a (shape (4,)) by broadcasting. This creates a (4, 3) array:
[[ 0 1 2]
[10 11 12]
[20 21 22]
[30 31 32]]
So, the correct answer is (D).
Correct Answer: D) [[ 0 1 2] [10 11 12] [20 21 22] [30 31 32]]
round(0.5) - round(-0.5) का नतीजा क्या है?
What is the result of round(0.5) – round(-0.5)?
In programming languages, the round() function rounds towards the nearest even integer when the value is exactly halfway between two integers (this is known as "bankers' rounding").
So:
round(0.5)is 0 (rounded to the nearest even integer).round(-0.5)is also 0 (rounded to the nearest even integer).
Therefore:
0−0=00 - 0 = 0
So, the correct result of round(0.5) - round(-0.5) is 0.
Correct Answer: C) 0(Zero)
कौन सी सूची अनुक्रमणिका उपरोक्त सूची से ‘red’ मान का चयन करेगी
Which list index would select the value 'red' from the above list
colors = ["red", "green", "burnt sienna", "blue"] To select the value 'red' from the list colors = ["red", "green", "burnt sienna", "blue"], you would use the index 0.
In Python, list indexing starts at 0, so:
Thus, the correct index is 0.
Correct Answer: B) 0
वर्गों का आउटपुट क्या होगा = {x: x*x for x in range(6)}
What will be the output of squares = {x: x*x for x in range(6)}
The code creates a dictionary where each key is a number from 0 to 5, and the value is its square.
So, the output is:
{0: 0, 1: 1, 2: 4, 3: 9, 4: 16, 5: 25}
The correct answer is (C).
Correct Answer: C) {0: 0, 1: 1, 2: 4, 3: 9, 4: 16, 5: 25}
वह कौन सा व्यंजक है जो 'baz' में 'z' लौटाता है?
What is the expression that returns the 'z' in 'baz'?
x=[10, [3.141, 20, [30, 'baz', 2.718]]] To access the 'z' in the string 'baz' from the given list:
The string 'baz' is located in the third position of the nested list (inside x[1][2]), and you can access the character 'z' by indexing into the string:
Here's the breakdown:
x[1]accesses the second element of the outer list:[3.141, 20, [30, 'baz', 2.718]].x[1][2]accesses the third element of that list:[30, 'baz', 2.718].x[1][2][1]accesses the second element of that inner list:'baz'.x[1][2][1][2]accesses the third character of the string'baz', which is'z'.
So, the correct expression is:
Correct Answer: C) x[1][2][0][2]
आप वेरिएबल a को लंबाई 1 का टपल कैसे असाइन करते हैं? (सभी सही हैं की जाँच करें।)
How do you assign a tuple of length 1 to the variable a? (Check all that are correct.)
To create a tuple of length 1, you must include a comma after the value:
- (A) a = (1,) is correct.
- (B) a = 1, is not valid.
- (C) a = [1] creates a list, not a tuple.
- (D) a = 1 assigns an integer, not a tuple.
So, the correct answer is (A).
Correct Answer: A) a = (1,)
जब निम्न कोड चलाया जाता है तो क्या प्रिंट होता है?
What is printed when the following code is run?
tup = ('30', '3', '2', '8')
print(sorted(tup, reverse = True)) The sorted() function sorts the tuple elements in reverse lexicographical (alphabetical) order.
For the tuple ('30', '3', '2', '8'), the sorted order in reverse is:
['8', '30', '3', '2'].
So, the correct answer is (D).
Correct Answer: C) ['30', '8', '3', '2']
आउटपुट क्या होगा?
What will be the output?
def f(x,y,z):
return x+ y+ z
f(2,30,400)
The function f(2, 30, 400) adds the values 2 + 30 + 400, which equals 432.
So, the correct answer is (A) 432.
Correct Answer: A) 432
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
What will be the output of the following Python code?
from numpy import random
x = random.randint(100)
print(x) The function random.randint(100) generates a random integer between 0 and 99. So, the output can be any number, like 56, 26, or 40.
Therefore, the correct answer is (D) All of the mentioned above.
Correct Answer: D) All of the mentioned above
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
What will be the output of the following python code?
min=(lambda x,y: x if x<y else y)
min(101*99, 102*98) The lambda function compares the two values:
101 * 99 = 9999102 * 98 = 9996
Since 9996 is smaller, the output will be 9996.
The correct answer is (C) 9996.
Correct Answer: C) 9996
जब आप निम्नलिखित कोड निष्पादित करते हैं तो क्या त्रुटि होगी?
What error will occur when you execute the following code?
MANGO = APPLE The code:
MANGO = APPLE
- In this case,
APPLEis not defined before it is used, so Python will raise a NameError because it doesn't recognizeAPPLEas a defined variable.
The correct answer is:
(A) Name error.
Correct Answer: A) Name error
निम्नलिखित फलन का अध्ययन कीजिए: इस कोड का आउटपुट क्या होगा?
Study the following function: What will be the output of this code?
import math
abs(math.sqrt(36))
The square root of 36 is 6.0. The abs() function returns the absolute value, but since 6.0 is already positive, the result remains 6.0.
So, the correct answer is (D) 6.0.
Correct Answer: D) 6.0
Python में ____ प्रकार के फंक्शन/मैथेड है।
There are ______ Functions/Method in Python Programming.
There are two types of function/method in python programming: pre-defined and user-defined.
Correct Answer: B) 2
डिफ़ॉल्ट रूप से, पायथन स्रोत फ़ाइलों को _______ में एन्कोडेड माना जाता है।
By default, Python source files are treated as encoded in _______.
By default, Python source files are treated as encoded in UTF-8.
Correct Answer: A) UTF-8