Connection restored!
Notification Center
Loading notifications...
Loading announcements...
INCOMING 1v1 DUEL! 10:00
@friend challenged you!
Topic · Room #HQ-0000
Accept & Join
Mention Scholar ↑↓ Enter / Click
Last time you were studying on Page 2.
STUDY & LEARNING DECK Filtered: 📜 PYQs

Govt Exam PYQs

Showing 25 of 2870 total questions (Latest Added First).

Timed Quiz
Newest Classic 25 Qs
No Questions Match Your Filter

Try clearing filters or unchecking "Saved" / "Hide".

Question 1426 NEW
📜 PYQs EASY
Which built-in Python function returns the total number of items in a list, string, tuple, or dictionary?
पायथन का कौन सा इनबिल्ट फंक्शन किसी लिस्ट, स्ट्रिंग, टपल या डिक्शनरी में कुल तत्वों की संख्या बताता है?
A
len()
len()
Correct
B
size()
size()
C
count()
count()
D
length()
length()
Solution Breakdown:
-> len("Python") returns 6, and len([10, 20, 30]) returns 3. -> Hence, Option (A) is the correct answer.
-> len() फंक्शन किसी भी सीक्वेंस या कलेक्शन की लंबाई (तत्वों की कुल संख्या) बताता है। -> इसलिए विकल्प (A) बिल्कुल सही है।
Question 1427 NEW
📜 PYQs MEDIUM
Which type of function arguments in Python allow you to pass values out of order by explicitly specifying the parameter names?
पायथन में किस प्रकार के फंक्शन आर्ग्युमेंट्स आपको पैरामीटर का नाम लिखकर किसी भी क्रम में मान पास करने की अनुमति देते हैं?
A
Required Arguments
रिक्वायर्ड आर्ग्युमेंट्स
B
Default Arguments
डिफ़ॉल्ट आर्ग्युमेंट्स
C
Positional Arguments
पोजिशनल आर्ग्युमेंट्स
D
Keyword Arguments
कीवर्ड आर्ग्युमेंट्स
Correct
Solution Breakdown:
-> With Keyword Arguments (e.g., student(age=20, name="Ravi")), Python matches values to parameters by name rather than position. -> Hence, Option (D) is the correct answer.
-> कीवर्ड आर्ग्युमेंट्स में पैरामीटर के नाम से मान मिलाए जाते हैं, इसलिए क्रम बदलने पर भी कोई त्रुटि नहीं होती। -> इसलिए विकल्प (D) बिल्कुल सही है।
Question 1428 NEW
📜 PYQs MEDIUM
What are the two standard modes in which the Python Interpreter can be used?
पायथन इंटरप्रेटर का उपयोग करने के दो मानक मोड कौन से हैं?
A
Compile Mode and Link Mode
कंपाइल मोड और लिंक मोड
B
Static Mode and Dynamic Mode
स्टैटिक मोड और डायनामिक मोड
C
Interactive Mode and Script Mode
इंटरैक्टिव मोड और स्क्रिप्ट मोड
Correct
D
Online Mode and Offline Mode
ऑनलाइन मोड और ऑफलाइन मोड
Solution Breakdown:
-> In Interactive Mode, you type and run commands one by one at the >>> prompt; in Script Mode, you write code in a .py file and run the entire file. -> Hence, Option (C) is the correct answer.
-> इंटरैक्टिव मोड में एक-एक कमांड सीधे शेल में चलता है, जबकि स्क्रिप्ट मोड में .py फाइल बनाकर पूरा प्रोग्राम चलाया जाता है। -> इसलिए विकल्प (C) बिल्कुल सही है।
Question 1429 NEW
📜 PYQs MEDIUM
In Python-MySQL database connectivity, which data type is returned by the cursor.fetchall() method?
पायथन-MySQL डेटाबेस कनेक्टिविटी में fetchall() मेथड द्वारा सामान्यतः कौन सा डेटा टाइप रिटर्न किया जाता है?
A
A single dictionary
एक सिंगल डिक्शनरी
B
A list of tuples (or an empty list if no rows are available)
टपल्स की एक लिस्ट (या कोई रो न होने पर खाली लिस्ट)
Correct
C
A single string
एक सिंगल स्ट्रिंग
D
An integer
एक पूर्णांक
Solution Breakdown:
-> fetchall() retrieves all remaining rows of a SQL query result set, representing each row as a tuple inside a Python list. -> Hence, Option (B) is the correct answer.
-> fetchall() क्वेरी की सभी पंक्तियों को एक लिस्ट के अंदर टपल्स के रूप में लौटाता है। -> इसलिए विकल्प (B) बिल्कुल सही है।
Question 1430 NEW
📜 PYQs MEDIUM
What is the output of the following Python pandas code? import pandas as pd pd.Series([10, 20], index=['A', 'B', 'C'])
उपरोक्त pandas कोड को चलाने पर क्या परिणाम आएगा?
A
ValueError
ValueError
Correct
B
SyntaxError
SyntaxError
C
NameError
NameError
D
IndexError
IndexError
Solution Breakdown:
-> The data list has 2 elements ([10, 20]) while the index list has 3 labels (['A', 'B', 'C']). This length mismatch raises a ValueError in Pandas. -> Hence, Option (A) is the correct answer.
-> डेटा में 2 तत्व और इंडेक्स में 3 लेबल होने के कारण लंबाई का मेल नहीं बैठता, जिससे ValueError आता है। -> इसलिए विकल्प (A) बिल्कुल सही है।
Question 1431 NEW
📜 PYQs MEDIUM
What is the output of the following NumPy code? import numpy as np A = np.array([12, 23]) B = np.array([10, 20]) print(A - B)
उपरोक्त NumPy कोड का आउटपुट क्या होगा?
A
[-2 -3]
[-2 -3]
B
[22 43]
[22 43]
C
[12 23]
[12 23]
D
[2 3]
[2 3]
Correct
Solution Breakdown:
-> NumPy performs element-wise subtraction on arrays of the same shape: [12 - 10, 23 - 20], outputting [2 3]. -> Hence, Option (D) is the correct answer.
-> NumPy समान आकार के एरे पर तत्व-दर-तत्व घटाव करता है, जिससे [2 3] प्राप्त होता है। -> इसलिए विकल्प (D) बिल्कुल सही है।
Question 1432 NEW
📜 PYQs MEDIUM
Which of the following is an INVALID attribute of a NumPy ndarray?
निम्नलिखित में से कौन सा NumPy एरे (ndarray) का एक अमान्य एट्रिब्यूट है?
A
shape
shape
B
ndim
ndim
C
length
length
Correct
D
dtype
dtype
Solution Breakdown:
-> Valid NumPy array attributes include ndim (dimensions), shape (tuple of dimensions), size (total elements), and dtype (data type). There is no .length attribute. -> Hence, Option (C) is the correct answer.
-> shape, ndim, size और dtype वैध NumPy एट्रिब्यूट हैं, जबकि length कोई एट्रिब्यूट नहीं है। -> इसलिए विकल्प (C) बिल्कुल सही है।
Question 1433 NEW
📜 PYQs EASY
In Python's NumPy library, what are the dimensions of an array called?
पायथन की NumPy लाइब्रेरी में किसी एरे के आयामों (Dimensions) को क्या कहा जाता है?
A
Lines
लाइन्स
B
Axes
एक्सेस
Correct
C
Bars
बार्स
D
Rows
रोज़
Solution Breakdown:
-> In NumPy, dimensions are called axes, and the total number of axes (dimensions) is returned by the .ndim attribute. -> Hence, Option (B) is the correct answer.
-> NumPy में एरे के आयामों को 'एक्सेस' (Axes) कहा जाता है। -> इसलिए विकल्प (B) बिल्कुल सही है।
Question 1434 NEW
📜 PYQs EASY
Which built-in Python module must be imported to use the mean(), median(), and mode() functions directly?
पायथन में mean(), median() और mode() फंक्शन का सीधे उपयोग करने के लिए किस मॉड्यूल को इम्पोर्ट करना होता है?
A
statistics
statistics
Correct
B
math
math
C
stats
stats
D
standard
standard
Solution Breakdown:
-> Python's standard library includes the statistics module specifically for statistical calculations like statistics.mean(), median(), and mode(). -> Hence, Option (A) is the correct answer.
-> पायथन की मानक लाइब्रेरी में सांख्यिकीय गणनाओं के लिए statistics मॉड्यूल दिया गया है। -> इसलिए विकल्प (A) बिल्कुल सही है।
Question 1435 NEW
📜 PYQs MEDIUM
What is the output of the following Python re (Regular Expression) code? import re print(re.sub(r'[ad]', '*', 'abcdef'))
उपरोक्त पायथन कोड का आउटपुट क्या होगा?
A
'*bcdef'
'*bcdef'
B
'abc*ef'
'abc*ef'
C
'bc*ef'
'bc*ef'
D
'*bc*ef'
'*bc*ef'
Correct
Solution Breakdown:
-> re.sub(pattern, replacement, string) replaces every match of the pattern. [ad] matches both 'a' and 'd', replacing them with '*' to produce '*bc*ef'. -> Hence, Option (D) is the correct answer.
-> re.sub() फंक्शन स्ट्रिंग में 'a' और 'd' दोनों को '*' से बदल देता है, जिससे '*bc*ef' प्राप्त होता है। -> इसलिए विकल्प (D) बिल्कुल सही है।
Question 1436 NEW
📜 PYQs MEDIUM
Which of the following while loops in Python will NOT run infinitely (i.e., will not execute even once)?
निम्नलिखित में से कौन सा पायथन while लूप अनंत बार नहीं चलेगा (अर्थात् एक बार भी नहीं चलेगा)?
A
while 21 % 2:
while 21 % 2:
B
while 21 // 2:
while 21 // 2:
C
while 1 % 1:
while 1 % 1:
Correct
D
while True:
while True:
Solution Breakdown:
-> In Python, 0 evaluates to False and any non-zero number evaluates to True. Since 1 % 1 = 0 (False), while 1 % 1: never enters the loop. -> Hence, Option (C) is the correct answer.
-> पायथन में 0 का अर्थ False होता है। चूंकि 1 % 1 = 0 है, इसलिए यह लूप एक बार भी नहीं चलेगा। -> इसलिए विकल्प (C) बिल्कुल सही है।
Question 1437 NEW
📜 PYQs MEDIUM
What is the output of the following Python lambda function code? x = lambda a, b : a * b print(x(5 * 2, 6 * 2))
उपरोक्त पायथन lambda फंक्शन कोड का आउटपुट क्या होगा?
A
30
30
B
120
120
Correct
C
34
34
D
60
60
Solution Breakdown:
-> A lambda is a small anonymous single-expression function. Here a = 5 * 2 = 10 and b = 6 * 2 = 12. The lambda returns a * b = 10 * 12 = 120. -> Hence, Option (B) is the correct answer.
-> यहाँ a = 10 और b = 12 पास किए गए हैं, जिनका गुणनफल 10 * 12 = 120 प्रिंट होगा। -> इसलिए विकल्प (B) बिल्कुल सही है।
Question 1438 NEW
📜 PYQs MEDIUM
What will be the output of the following Python code? ```python Txt = list('PEACE') print(Txt)
उपरोक्त पायथन कोड का आउटपुट क्या होगा?
A
['P', 'E', 'A', 'C', 'E']
['P', 'E', 'A', 'C', 'E']
Correct
B
['PEACE']
['PEACE']
C
('P', 'E', 'A', 'C', 'E')
('P', 'E', 'A', 'C', 'E')
D
Error
एरर
Solution Breakdown:
-> The list() constructor iterates over the string 'PEACE' and splits each individual character into a separate element of a new list. -> Hence, Option (A) is the correct answer.
-> list() फंक्शन स्ट्रिंग के प्रत्येक अक्षर को अलग-अलग तत्व के रूप में एक नई लिस्ट में बदल देता है। -> इसलिए विकल्प (A) बिल्कुल सही है।
Question 1439 NEW
📜 PYQs MEDIUM
What will be the data type of `Msg` in the following Python statement: `Msg = ('Good Day')`?
पायथन कथन `Msg = ('Good Day')` में `Msg` का डेटा टाइप क्या होगा?
A
`tuple`
टपल
B
`list`
लिस्ट
C
`dict`
डिक्शनरी
D
`str` (String)
स्ट्रिंग
Correct
Solution Breakdown:
-> Parentheses around a single string without a trailing comma are treated simply as grouping, so `Msg` is a `str`. To make a 1-element tuple, a trailing comma is required: `('Good Day', )`. -> Hence, Option (D) is the correct answer.
-> एक तत्व के बाद कॉमा न होने पर पायथन उसे टपल नहीं बल्कि सामान्य स्ट्रिंग (`str`) मानता है। -> इसलिए विकल्प (D) बिल्कुल सही है।
Question 1440 NEW
📜 PYQs EASY
Which function from Python's `os` module is used to delete a single file from the system?
सिस्टम से किसी एकल फाइल को डिलीट करने के लिए पायथन के `os` मॉड्यूल के किस फंक्शन का उपयोग किया जाता है?
A
`os.delete()`
`os.delete()`
B
`os.del()`
`os.del()`
C
`os.remove()`
`os.remove()`
Correct
D
`os.put()`
`os.put()`
Solution Breakdown:
-> `os.remove("file.txt")` deletes a single file, while `os.rmdir("folder")` removes an empty directory. -> Hence, Option (C) is the correct answer.
-> एकल फाइल हटाने के लिए `os.remove()` और खाली फोल्डर हटाने के लिए `os.rmdir()` का उपयोग होता है। -> इसलिए विकल्प (C) बिल्कुल सही है।
Question 1441 NEW
📜 PYQs EASY
What is the correct order of file-handling operations in Python?
पायथन में फाइल प्रोसेसिंग के चरणों का सही क्रम क्या है?
A
Close file -> Open file -> Read/Write
फाइल बंद करना -> फाइल खोलना -> पढ़ना/लिखना
B
Open file -> Read/Write -> Close file
फाइल खोलना -> पढ़ना/लिखना -> फाइल बंद करना
Correct
C
Read/Write -> Open file -> Close file
पढ़ना/लिखना -> फाइल खोलना -> फाइल बंद करना
D
Open file -> Close file -> Read/Write
फाइल खोलना -> फाइल बंद करना -> पढ़ना/लिखना
Solution Breakdown:
-> First you open a file using `open()`, perform read or write operations, and finally release system resources using `close()`. -> Hence, Option (B) is the correct answer.
-> फाइल हैंडलिंग का मानक क्रम है: पहले फाइल खोलना (`open()`), फिर डेटा पढ़ना/लिखना, और अंत में फाइल बंद करना (`close()`)। -> इसलिए विकल्प (B) बिल्कुल सही है।
Question 1442 NEW
📜 PYQs EASY
Which statement is used in Python to immediately stop a `while` or `for` loop even if its condition is still `True`?
पायथन में किसी `while` या `for` लूप की शर्त `True` होने के बावजूद उसे तुरंत रोकने के लिए किस स्टेटमेंट का उपयोग किया जाता है?
A
`break`
`break`
Correct
B
`continue`
`continue`
C
`pass`
`pass`
D
`assert`
`assert`
Solution Breakdown:
-> `break` exits the enclosing loop immediately, whereas `continue` skips only the current iteration and `pass` does nothing (a placeholder). -> Hence, Option (A) is the correct answer.
-> `break` लूप को तुरंत समाप्त कर देता है, जबकि `continue` केवल वर्तमान चरण को छोड़ता है। -> इसलिए विकल्प (A) बिल्कुल सही है।
Question 1443 NEW
📜 PYQs EASY
Which keyword is used in Python to create a short alias when importing a module (e.g., `import numpy as np`)?
पायथन में किसी मॉड्यूल को इम्पोर्ट करते समय छोटा उपनाम (Alias) बनाने के लिए किस कीवर्ड का उपयोग किया जाता है?
A
`from`
`from`
B
`in`
`in`
C
`alias`
`alias`
D
`as`
`as`
Correct
Solution Breakdown:
-> The `as` keyword creates a convenient shorthand alias (like `import pandas as pd`) so you don't have to type the full module name repeatedly. -> Hence, Option (D) is the correct answer.
-> `as` कीवर्ड का उपयोग मॉड्यूल का संक्षिप्त उपनाम बनाने के लिए किया जाता है। -> इसलिए विकल्प (D) बिल्कुल सही है।
Question 1444 NEW
📜 PYQs EASY
What does the Python Membership Operator expression `x in y` return?
पायथन में मेम्बरशिप ऑपरेटर व्यंजक `x in y` क्या परिणाम देता है?
A
Returns `True` if both variables are numbers
यदि दोनों वेरिएबल संख्याएँ हैं तो `True` देता है
B
Returns `True` if `x` is greater than `y`
यदि `x`, `y` से बड़ा है तो `True` देता है
C
Returns `True` if the value `x` is found inside the sequence/object `y`
यदि मान `x` सीक्वेंस/ऑब्जेक्ट `y` के अंदर मौजूद है तो `True` देता है
Correct
D
Always returns `False`
हमेशा `False` देता है
Solution Breakdown:
-> For example, `"a" in "apple"` evaluates to `True`, while `"z" in "apple"` evaluates to `False`. -> Hence, Option (C) is the correct answer.
-> उदाहरण के लिए, `"a" in "apple"` का परिणाम `True` आएगा क्योंकि `'a'` शब्द `"apple"` में मौजूद है। -> इसलिए विकल्प (C) बिल्कुल सही है।
Question 1445 NEW
📜 PYQs EASY
Which of the following is NOT an Arithmetic Operator in Python?
निम्नलिखित में से कौन सा पायथन में एक अंकगणितीय ऑपरेटर नहीं है?
A
Floor Division (`//`)
फ्लोर डिवीज़न
B
`not in`
नॉट इन
Correct
C
Exponent (`**`)
एक्सपोनेंट
D
Modulus (`%`)
मॉड्यूलस
Solution Breakdown:
-> `//` (floor division), `**` (exponentiation), and `%` (modulus) are Arithmetic operators, whereas `in` and `not in` are Membership operators. -> Hence, Option (B) is the correct answer.
-> `in` और `not in` मेम्बरशिप ऑपरेटर हैं, अंकगणितीय ऑपरेटर नहीं। -> इसलिए विकल्प (B) बिल्कुल सही है।
Question 1446 NEW
📜 PYQs MEDIUM
Which of the following is an INVALID method for a Python Dictionary?
पायथन डिक्शनरी के लिए निम्नलिखित में से कौन सा एक अमान्य मेथड है?
A
`remove()`
`remove()`
Correct
B
`get()`
`get()`
C
`pop()`
`pop()`
D
`popitem()`
`popitem()`
Solution Breakdown:
-> `get()`, `pop()`, and `popitem()` are valid Dictionary methods. `remove()` belongs to Lists and Sets, NOT Dictionaries. -> Hence, Option (A) is the correct answer.
-> `remove()` मेथड लिस्ट और सेट में उपयोग होता है, डिक्शनरी में नहीं। -> इसलिए विकल्प (A) बिल्कुल सही है।
Question 1447 NEW
📜 PYQs EASY
What is an unordered/indexed collection of unique `key: value` pairs enclosed in curly braces `{}` in Python called?
पायथन में कर्ली ब्रेसेज़ `{}` के अंदर `key: value` जोड़ों के संग्रह को क्या कहा जाता है?
A
Tuple
टपल
B
List
लिस्ट
C
String
स्ट्रिंग
D
Dictionary
डिक्शनरी
Correct
Solution Breakdown:
-> A Python Dictionary stores data as `key: value` pairs (e.g., `{"name": "Amit", "age": 20}`), where every key must be unique. -> Hence, Option (D) is the correct answer.
-> पायथन डिक्शनरी डेटा को `key: value` के रूप में स्टोर करती है, जहाँ प्रत्येक कुंजी (Key) यूनिक होती है। -> इसलिए विकल्प (D) बिल्कुल सही है।
Question 1448 NEW
📜 PYQs EASY
Which sequence data type in Python is ordered, allows duplicate values, is enclosed in parentheses `()`, and is IMMUTABLE (cannot be changed after creation)?
पायथन में कौन सा सीक्वेंस डेटा टाइप क्रमबद्ध होता है, डुप्लीकेट मान स्वीकार करता है, कोष्ठक `()` में लिखा जाता है और बनने के बाद बदला नहीं जा सकता?
A
List
लिस्ट
B
Dictionary
डिक्शनरी
C
Tuple
टपल
Correct
D
Set
सेट
Solution Breakdown:
-> A Tuple is an immutable sequence enclosed in `()`. Once created, you cannot add, remove, or modify its elements. -> Hence, Option (C) is the correct answer.
-> टपल एक इम्यूटेबल (अपरिवर्तनीय) सीक्वेंस है जिसे `()` में लिखा जाता है; एक बार बनने के बाद इसमें बदलाव नहीं किया जा सकता। -> इसलिए विकल्प (C) बिल्कुल सही है।
Question 1449 NEW
📜 PYQs EASY
In Python, which negative index is used to directly access the LAST item of any list, regardless of its length?
पायथन में किसी भी लिस्ट के अंतिम आइटम को सीधे एक्सेस करने के लिए किस नेगेटिव इंडेक्स का उपयोग किया जाता है?
A
`0`
`0`
B
`-1`
`-1`
Correct
C
`1`
`1`
D
`-0`
`-0`
Solution Breakdown:
-> Python supports negative indexing from the end of a sequence: `-1` refers to the last element, `-2` to the second-last, and so on. -> Hence, Option (B) is the correct answer.
-> पायथन में `-1` इंडेक्स हमेशा लिस्ट या स्ट्रिंग के अंतिम तत्व को दर्शाता है। -> इसलिए विकल्प (B) बिल्कुल सही है।
Question 1450 NEW
📜 PYQs EASY
Which built-in method is used in Python to add a single item to the END of an existing list?
पायथन में किसी मौजूदा लिस्ट के अंत में एक नया आइटम जोड़ने के लिए किस मेथड का उपयोग किया जाता है?
A
`append()`
`append()`
Correct
B
`add()`
`add()`
C
`push()`
`push()`
D
`insert_end()`
`insert_end()`
Solution Breakdown:
-> `list.append(item)` adds the specified element to the very end of the list (e.g., `fruits.append("orange")`). -> Hence, Option (A) is the correct answer.
-> `append()` मेथड किसी लिस्ट के अंत में नया तत्व जोड़ता है। -> इसलिए विकल्प (A) बिल्कुल सही है।
Prev 56 57 58 59 60 Next
ESSENTIAL STUDY KIT

Master Govt Exam PYQs Faster with Recommended Resources

Pair your daily MCQ practice with these educator-picked books, practice sets, and typing gear tailored for this syllabus.

Visit Exam Store
Dell KB216 Wired Multimedia USB Keyboard (Black)
Typing Keyboards Best for Mangal Typing Amazon
Dell KB216 Wired Multimedia USB Keyboard (Black)

Soft chiclet keys and zero lag — the best keyboard for UPP Computer Operator and DSSSB 40+ WPM Hindi/English typing tests.

₹299 ₹999 70% OFF
Affiliate Disclosure: HappyQuiz may earn a small commission on qualifying purchases at no extra cost to you.
Saved to your dashboard!