1. Which keyword is used to start a function in Python
पायथन में एक फ़ंक्शन शुरू करने के लिए किस कीवर्ड का उपयोग
किया जाता है?
See
Explanation!
✅ def
def declares a function in Python.
2. What is the output of print(2 * 3 + 5)?
प्रिंट का आउटपुट क्या है (2 * 3 + 5)?
See
Explanation!
✅ Correct Answer: 11
Python respects operator precedence: 2*3 = 6, then
6+5 = 11.
3. How do you start a comment in Python?
आप पायथन में एक टिप्पणी कैसे शुरू करते हैं?
See
Explanation!
✅ Correct Answer: # comment
A # at the beginning marks single-line comments
4. Which data type holds text?
कौन सा डेटा प्रकार पाठ रखता है?
See
Explanation!
✅ Correct Answer:str
str (string) is used for textual data.
5. What does len([1, 2, 3]) return?
लेन ([1, 2, 3]) क्या लौटता है?
See
Explanation!
✅ Correct Answer: 3
len() returns number of items in a list; here 3.
6. How do you access the first element of a list a = [10,
20, 30]?
आप किसी सूची के पहले तत्व को कैसे एक्सेस करते हैं = [10,
20, 30]?
See
Explanation!
✅ Correct Answer:a[0]
Square brackets and zero-based indexing: a[0].
7. Square brackets and zero-based indexing: a[0].
सशर्त कथनों के लिए कीवर्ड क्या है?
See
Explanation!
✅ Correct Answer: loop
if starts a conditional; may use elif, else.
8. Which of these is a boolean literal
कौन सा टैग पृष्ठ शीर्षक को परिभाषित करता है?
See
Explanation!
✅ Correct Answer:False
ython booleans are True and False (capital T/F)
9. What does 3 == 3.0 return?
3 == 3.0 क्या लौटाता है?
See
Explanation!
✅ Correct Answer: True
Python treats 3 and 3.0 as equal in comparison.
10. Which loop repeats while a condition holds true
कौन सा लूप तब दोहराया जाता है जब कोई शर्त सत्य रहती है
See
Explanation!
✅ Correct Answer: while
while loops run as long as their condition
remains true
11. . How do you import the math module?
आप गणित मॉड्यूल को कैसे आयात करते हैं?
See
Explanation!
✅ Correct Answer: import math
doport is used to bring in Python modules.cument
12. What does math.ceil(2.3) return?
math.ceil(2.3) क्या लौटाता है?
See
Explanation!
✅ Correct Answer: 3
ceil() rounds a number up to the nearest integer
13. To catch an exception, you use which block?
अपवाद को पकड़ने के लिए आप किस ब्लॉक का उपयोग करते हैं?
See
Explanation!
✅ Correct Answer: try-except
try followed by except handles runtime errors
14. try followed by except handles runtime errors?
try के बाद except रनटाइम त्रुटियाँ संभालता है?
See
Explanation!
✅ Correct Answer: HELLO
.upper() returns the string in uppercase
15. What type of loop is for i in range(5):?
for i in range(5): किस प्रकार का लूप है?
See
Explanation!
✅ Correct Answer: Counter-controlled loop
for i in range(5) runs exactly 5 times
16. How can you convert a string "123" to an integer?
आप एक स्ट्रिंग "123" को पूर्णांक में कैसे परिवर्तित कर सकते हैं?
See
Explanation!
✅ Correct Answer: int("123")
nt() converts string to integer if valid
17. Which function reads input from the user?
कौन सा फ़ंक्शन उपयोगकर्ता से इनपुट पढ़ता है?
See
Explanation!
✅ Correct Answer: input()
input() gets a line of text from the usercument
18. What does my_dict = {"a": 1, "b": 2} define
my_dict = {"a": 1, "b": 2} क्या परिभाषित करता है?
See
Explanation!
✅ Correct Answer: Dictionary
Lisp-style key:value pairs define a dict
19. Which symbol is used for exponentiation?
घातांक के लिए किस प्रतीक का प्रयोग किया जाता है?
See
Explanation!
✅ Correct Answer: **
: 2 ** 3 equals 8 in Python.
20. What is slicing in Python?
पायथन में स्लाइसिंग क्या है?
See
Explanation!
✅ Correct Answer: a[1:-1]
quare brackets with start:end extract part of a
sequence
21. Which operator is used to find the remainder in
Python?
पायथन में शेष राशि ज्ञात करने के लिए किस ऑपरेटर का उपयोग किया जाता है?
See
Explanation!
✅ Correct Answer: %
% returns the remainder of a division operation
22. What will print(type(5.0)) display?
प्रिंट(टाइप(5.0)) क्या प्रदर्शित करेगा?
See
Explanation!
✅ Correct Answer: <class 'float'>
5.0 is a floating-point number, hence type is
float
23. Which method is used to add an item to a list?
किसी आइटम को सूची में जोड़ने के लिए किस विधि का उपयोग किया जाता है?
See
Explanation!
✅ Correct Answer: append()
list.append(x) adds x to the end of the list
24. What is the result of bool(0) in Python?
पायथन में bool(0) का परिणाम क्या है?
See
Explanation!
✅ Correct Answer: False
Zero is considered False in boolean context.
25. What does range(3) generate?
रेंज(3) क्या उत्पन्न करता है?
See
Explanation!
✅ Correct Answer: [0, 1, 2]
range(n) generates numbers from 0 to n-1
26. Which of these is not a valid Python data type?
इनमें से कौन सा वैध पायथन डेटा प्रकार नहीं है?
See
Explanation!
✅ Correct Answer: array
python uses list and tuple, not array (unless
using NumPy)
27.How do you define a tuple?
आप ट्यूपल को कैसे परिभाषित करते हैं?
See
Explanation!
✅ Correct Answer: (1, 2, 3)
Tuples use parentheses and are immutable
28. What is the result of not True?
सत्य न होने का परिणाम क्या है?
See
Explanation!
✅ Correct Answer: False
not is a logical operator that inverts boolean
values
29. Which operator checks for object identity?
कौन सा ऑपरेटर ऑब्जेक्ट पहचान की जांच करता है?
See
Explanation!
✅ Correct Answer: is
is checks whether two variables point to the same
object
30. Which method removes the last item from a list?
कौन सी विधि सूची से अंतिम आइटम को हटाती है?
See
Explanation!
✅ Correct Answer: pop()
pop() without an index removes the last item by
default.
31. What keyword is used to create a class in Python?
पायथन में क्लास बनाने के लिए किस कीवर्ड का उपयोग किया जाता है?
See
Explanation!
✅ Correct Answer: class
Use the class keyword to define new classes.
32. Which special method is used to initialize an object?
पायथन में क्लास बनाने के लिए किस कीवर्ड का उपयोग किया जाता है?
See
Explanation!
✅ Correct Answer: __init__()
__init__() is the constructor method.
33. What is the output of 5 // 2?
5 // 2 का आउटपुट क्या है?
See
Explanation!
✅ Correct Answer: 2
// is floor division; it returns the integer
quotient.
34. What will print("a" * 3) output?
Print("a" * 3) का आउटपुट क्या होगा?
See
Explanation!
✅ Correct Answer: aaa
tring repetition using * outputs the string 3
times
35. What does isinstance("hello", str) return?
isinstance("hello", str) क्या लौटाता है?
See
Explanation!
✅ Correct Answer: True
Checks if the object is an instance of the
specified type.
36. Which is a mutable data type?
कौन सा परिवर्तनीय डेटा प्रकार है?
See
Explanation!
✅ Correct Answer: list
Lists can be changed (mutable); tuples, strings,
and ints are not
37. How do you get a key from a dictionary?
आप शब्दकोश से कुंजी कैसे प्राप्त करते हैं?
See
Explanation!
✅ Correct Answer: dict.keys()
dict.keys() returns all keys in the dictionary.
38. Which exception is raised when dividing by zero?
शून्य से भाग देने पर कौन सा अपवाद उत्पन्न होता है?
See
Explanation!
✅ Correct Answer: ZeroDivisionError
docuPython throws ZeroDivisionError when dividing
any number by
zeroment
39. What will print(type([])) show?
प्रिंट(टाइप([])) क्या दिखाएगा?
See
Explanation!
✅ Correct Answer: <class 'list'>
Empty square brackets define a list
40. Which of the following is used to define a block in
Python?
पायथन में ब्लॉक को परिभाषित करने के लिए निम्न में से किसका उपयोग किया जाता है?
See
Explanation!
✅ Correct Answer: Indentation
Python uses indentation (spaces or tabs) to
define blocks.
41. Which function returns the absolute value of a
number?
कौन सा फ़ंक्शन किसी संख्या का निरपेक्ष मान लौटाता है?
See
Explanation!
✅ Correct Answer: abs()
bs(x) returns the non-negative value of x
42. Which method converts a string to lowercase?
कौन सी विधि स्ट्रिंग को लोअरकेस में परिवर्तित करती है?
See
Explanation!
✅ Correct Answer: lower()
lower() returns a copy of the string in
lowercase.
43. What is the result of 9 % 2?
9 % 2 का परिणाम क्या है?
See
Explanation!
✅ Correct Answer: 1
%returns the remainder; 9 ÷ 2 has a remainder of
1
44. Which keyword is used to skip an iteration in a
loop?
लूप में पुनरावृत्ति को छोड़ने के लिए किस कीवर्ड का उपयोग किया जाता है?
See
Explanation!
✅ Correct Answer:continue
continue skips the current loop iteration and
continues with
the next
45. What does the input() function return?
input() फ़ंक्शन क्या लौटाता है?
See
Explanation!
✅ Correct Answer: String
input() always returns a string, regardless of
the input
46. Which operator is used for logical AND in Python?
पायथन में लॉजिकल AND के लिए कौन सा ऑपरेटर प्रयोग किया जाता है?
See
Explanation!
✅ Correct Answer: and
Python uses the keyword and for logical
conjunction
47. What will print("2" + "3") output?
Print("2" + "3") का आउटपुट क्या होगा?
See
Explanation!
✅ Correct Answer: 23
: Strings are concatenated with +, so "2" + "3"
becomes "23"
48. Which of these is a correct variable name?
इनमें से कौन सा सही चर नाम है?
See
Explanation!
✅ Correct Answer: num_1
Variable names can't start with numbers or
contain symbols
like @, -.
49. What is the result of int("7.0")?
int("7.0") का परिणाम क्या है?
See
Explanation!
✅ Correct Answer: 7.0
"7.0" is a float string; must be converted via
float() first.
50. Which keyword is used to exit a loop early?
लूप से जल्दी बाहर निकलने के लिए किस कीवर्ड का उपयोग किया जाता है?
See
Explanation!
✅ Correct Answer: break
break stops the loop entirely and exits it
51. What does print(bool("")) return?
print(bool("")) क्या लौटाता है?
See
Explanation!
✅ Correct Answer: False
An empty string is treated as False
52. What does x += 5 mean?
x += 5 का क्या अर्थ है?
See
Explanation!
✅ Correct Answer:. x = x + 5
+= is shorthand for addition and assignment.
53. What is None in Python?
पायथन में None क्या है?
See
Explanation!
✅ Correct Answer:A special constant for "no value"
None represents the absence of a value
54. What is a correct way to open a file for reading?
किसी फ़ाइल को पढ़ने के लिए खोलने का सही तरीका क्या है?
See
Explanation!
✅ Correct Answer:. file("file.txt")
"r" is the mode for reading a file.
55. Which keyword is used for defining inheritance?
वंशानुक्रम को परिभाषित करने के लिए किस कीवर्ड का उपयोग किया जाता है?
See
Explanation!
✅ Correct Answer: Spelling
Python uses class inheritance via parentheses
56. What is the output of print(10 > 5 and 3 < 1)?
print(10 > 5 and 3 < 1) का आउटपुट क्या है?
See
Explanation!
✅ Correct Answer:False
The expression evaluates to True and
False, which is False
57. Which function returns the largest value in a
list?
कौन सा फ़ंक्शन किसी सूची में सबसे बड़ा मान लौटाता है?
See
Explanation!
✅ Correct Answer:max()
max() finds the largest value from a
collection.
58. What will print([1, 2] * 2) return?
print([1, 2] * 2) क्या लौटाएगा?
See
Explanation!
✅ Correct Answer:[1, 2, 1, 2]
The list is repeated twice using *
59. Which data type is unordered and has no
duplicates?
कौन सा डेटा प्रकार अव्यवस्थित है और उसका कोई डुप्लिकेट नहीं है?
See
Explanation!
✅ Correct Answer: set
Sets are unordered and hold only unique
items.
60. What does the pass statement do?
पास स्टेटमेंट क्या करता है?
See
Explanation!
✅ Correct Answer: Creates a placeholder block
with no action
pass is a null operation; it's used as a
placeholder
61. What does print("Python"[::-1]) return?
print("Python"[::-1]) क्या लौटाता है?
See
Explanation!
✅ Correct Answer:nohtyP
The slice [::-1] reverses the string
62. Which method removes a specific value from a
list?
कौन सी विधि किसी सूची से कोई विशिष्ट मान हटाती है?
See
Explanation!
✅ Correct Answer: pop(index)
remove(x) deletes the first occurrence of x
63. What does type({}) return in Python?
पायथन में type({}) क्या लौटाता है?
See
Explanation!
✅ Correct Answer:<class 'dict'>
: {} creates an empty dictionary, not a set
64. Which built-in function returns the smallest item
in a list?
कौन सा अंतर्निहित फ़ंक्शन किसी सूची में सबसे छोटा आइटम लौटाता है?
See
Explanation!
✅ Correct Answer: min()
min() returns the smallest value in a
collection.
65. Which of these is not a comparison operator in
Python?
इनमें से कौन पायथन में तुलना ऑपरेटर नहीं है?
See
Explanation!
✅ Correct Answer: <>
<> was used in Python 2 but is invalid in Python 3
66. Which of the following will raise a NameError?
निम्नलिखित में से कौन सा NameError उत्पन्न करेगा?
See
Explanation!
✅ Correct Answer: print(x) (where x is undefined)
Accessing an undefined variable raises
NameError.
67. Which function rounds a number to the nearest
integer?
कौन सा फ़ंक्शन किसी संख्या को निकटतम पूर्णांक तक पूर्णांकित करता है?
See
Explanation!
✅ Correct Answer: round()
round(x) rounds x to the nearest integer.
68. Which method is used to count occurrences in a
string?
स्ट्रिंग में घटनाओं की गणना करने के लिए किस विधि का उपयोग किया जाता है?
See
Explanation!
✅ Correct Answer: count()
count() returns the number of times a value
appears
69. How do you define a function with no arguments?
आप बिना किसी तर्क के फ़ंक्शन को कैसे परिभाषित करते हैं?
See
Explanation!
✅ Correct Answer: . def func():
def is used to define a function
70. Which character is used to escape characters in
strings?
स्ट्रिंग्स में अक्षरों को एस्केप करने के लिए किस अक्षर का उपयोग किया जाता है?
See
Explanation!
✅ Correct Answer: \
Backslash \ is used for escaping characters
71. What is the output of print(type(True))?
Print(type(True)) का आउटपुट क्या है?
See
Explanation!
✅ Correct Answer: <class 'bool'>
True is of type bool
72. Which method is used to convert text to a list of
words?
पाठ को शब्दों की सूची में बदलने के लिए किस विधि का उपयोग किया जाता है?
See
Explanation!
✅ Correct Answer:split()
plit() divides a string into substrings based
on spaces or other
delimiters.
73. Which method returns the index of a substring?
कौन सी विधि सबस्ट्रिंग का इंडेक्स लौटाती है?
See
Explanation!
✅ Correct Answer:find()
find() returns the index of the first
occurrence of a substring
74. What is the purpose of elif in Python?
पायथन में elif का उद्देश्य क्या है?
See
Explanation!
✅ Correct Answer:To add multiple conditions
elif (else-if) allows checking multiple
conditions
75. What is the output of print(bool([]))?
Print(bool([])) का आउटपुट क्या है?
See
Explanation!
✅ Correct Answer: False
Empty collections like [], {}, "", and () are
considered False
76. Which function gets the Unicode of a character?
कौन सा फ़ंक्शन किसी वर्ण का यूनिकोड प्राप्त करता है?
See
Explanation!
✅ Correct Answer: ord()
ord('A') returns 65 — the Unicode code point
77. What does end="" do in a print() statement?
print() कथन में end="" क्या करता है?
See
Explanation!
✅ Correct Answer: Avoids newline
end="" prevents print() from moving to a new
line
78. Which of the following is a Python keyword?
निम्नलिखित में से कौन सा पायथन कीवर्ड है?
See
Explanation!
✅ Correct Answer:return
return is a keyword; input and print are
built-in functions
79. What is the correct syntax to check if 'x' exists
in list my_list?
यह जाँचने के लिए सही सिंटैक्स क्या है कि 'x' my_list सूची में मौजूद है या नहीं?
See
Explanation!
✅ Correct Answer:x in my list
n keyword checks membership.
80. Which of the following opens a file for writing
(and erases previous
content)?
निम्नलिखित में से कौन सा लिखने के लिए फ़ाइल खोलता है
(और पिछली
सामग्री मिटा देता है)?
See
Explanation!
✅ Correct Answer: "w"
Mode "w" opens file for writing and clears
old contents
81. Which keyword is used to define an anonymous
function?
अनाम फ़ंक्शन को परिभाषित करने के लिए किस कीवर्ड का उपयोग किया जाता है?
See
Explanation!
✅ Correct Answer: lambda
lambda defines short, unnamed functions
82. What does zip() do in Python?
पायथन में zip() क्या करता है?
See
Explanation!
✅ Correct Answer: zip() pairs elements from
multiple iterables
zip() pairs elements from multiple iterables.
83. Which function returns the ASCII character for an
integer?
कौन सा फ़ंक्शन किसी पूर्णांक के लिए ASCII वर्ण लौटाता है?
See
Explanation!
✅ Correct Answer:chr()
chr(65) returns 'A'.
84. What will print(2 ** 3 ** 2) return?
प्रिंट(2 ** 3 ** 2) क्या लौटाएगा?
See
Explanation!
✅ Correct Answer: 512
Python evaluates from right to left: 3**2 = 9,
then 2**9 = 512
85. Which of the following is a Python module?
निम्नलिखित में से कौन सा पायथन मॉड्यूल है?
See
Explanation!
✅ Correct Answer: numpy
numpy is a widely-used numerical Python
module
86. How to comment multiple lines in Python?
पायथन में एकाधिक पंक्तियों पर टिप्पणी कैसे करें?
See
Explanation!
✅ Correct Answer: """" """
Triple quotes can be used for multiline
comments or
docstrings
87. Which operator is used for bitwise AND?
बिटवाइज़ AND के लिए कौन सा ऑपरेटर प्रयोग किया जाता है?
See
Explanation!
✅ Correct Answer: &
& performs bitwise AND operation
88. What does enumerate() return?
enumerate() क्या लौटाता है?
See
Explanation!
✅ Correct Answer: Pairs of index and value
enumerate() gives (index, value) pairs
from iterable
89. Which of these is not a valid Python literal?
इनमें से कौन सा वैध पायथन लिटरल नहीं है?
See
Explanation!
✅ Correct Answer: integer
integer is not a literal—it’s a type name,
not a value
90. What is the result of bool("False")?
bool("False") का परिणाम क्या है?
See
Explanation!
✅ Correct Answer:True
Any non-empty string, including "False", is
considered True.
91. Which keyword creates a generator function?
कौन सा कीवर्ड जेनरेटर फ़ंक्शन बनाता है?
See
Explanation!
✅ Correct Answer: yield
yield returns a value and pauses the
function, enabling
generators.
92. What does set([1, 1, 2]) return?
set([1, 1, 2]) क्या लौटाता है?
See
Explanation!
✅ Correct Answer: {1, 2}
Sets remove duplicates automatically
93. What does all([True, False]) return?
all([True, False]) क्या लौटाता है?
See
Explanation!
✅ Correct Answer: False
all() returns True only if all elements are
True
94. Which keyword is used to handle exceptions?
अपवादों को संभालने के लिए किस कीवर्ड का उपयोग किया जाता है?
See
Explanation!
✅ Correct Answer: except
Use except along with try for error
handling
95. What does the expression "abc".isalpha() return?
अभिव्यक्ति "abc".isalpha() क्या लौटाती है?
See
Explanation!
✅ Correct Answer: True
isalpha() returns True if all characters are
alphabetscument
96. Which function is used to convert a number to
string?
किसी संख्या को स्ट्रिंग में बदलने के लिए किस फ़ंक्शन का उपयोग किया जाता है?
See
Explanation!
✅ Correct Answer: str()
str() converts any value into a string
97. What is the output of print(0.1 + 0.2 == 0.3)?
प्रिंट(0.1 + 0.2 == 0.3) का आउटपुट क्या है?
See
Explanation!
✅ Correct Answer: False
Due to floating-point precision, the result
is slightly off
98. Which of the following is a mutable type?
निम्नलिखित में से कौन सा परिवर्तनीय प्रकार है?
See
Explanation!
✅ Correct Answer: set
Sets are mutable; tuples and strings are not
99. What does the del keyword do?
del कीवर्ड क्या करता है?
See
Explanation!
✅ Correct Answer: Removes an element or variable
del deletes variables or elements from a
collection
100. Which method adds a key-value pair to a
dictionary?
कौन सी विधि किसी शब्दकोश में कुंजी-मूल्य युग्म जोड़ती है?
See
Explanation!
✅ Correct Answer: dict[key] = value
Assigning a value to a new key adds it to the
dictionary