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

Programming Languages

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

Timed Quiz
Newest Classic 25 Qs
No Questions Match Your Filter

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

Question 126 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 127 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 128 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 129 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 130 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 131 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 132 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 133 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 134 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 135 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 136 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 137 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 138 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 139 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 140 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) बिल्कुल सही है।
Question 141 NEW
📜 PYQs EASY
Which of the following correctly creates a "List" in Python?
निम्नलिखित में से कौन सा पायथन में सही ढंग से "लिस्ट" बनाता है?
A
`fruits = ("apple", "banana")`
`fruits = ("apple", "banana")`
B
`fruits = {"apple", "banana"}`
`fruits = {"apple", "banana"}`
C
`fruits = <"apple", "banana">`
`fruits = <"apple", "banana">`
D
`fruits = ["apple", "banana"]`
`fruits = ["apple", "banana"]`
Correct
Solution Breakdown:
-> In Python: Square brackets `[ ]` create a List (ordered, mutable), parentheses `( )` create a Tuple (ordered, immutable), and curly braces `{ }` create a Set or Dictionary. -> Hence, Option (D) is the correct answer.
-> पायथन में लिस्ट बनाने के लिए स्क्वायर ब्रैकेट `[ ]`, टपल के लिए `( )` और सेट/डिक्शनरी के लिए `{ }` का उपयोग होता है। -> इसलिए विकल्प (D) बिल्कुल सही है।
Question 142 NEW
📜 PYQs EASY
How does Python define code blocks (such as the body of an `if` statement, loop, or function)?
पायथन में कोड ब्लॉक्स (जैसे `if` स्टेटमेंट, लूप या फंक्शन की बॉडी) को कैसे परिभाषित किया जाता है?
A
Using curly braces `{ }`
कर्ली ब्रेसेज़ `{ }` का उपयोग करके
B
Using `BEGIN` and `END` keywords
`BEGIN` और `END` कीवर्ड्स का उपयोग करके
C
Using Indentation (leading whitespace)
इंडेंटेशन (शुरुआती खाली स्थान) का उपयोग करके
Correct
D
Using square brackets `[ ]`
स्क्वायर ब्रैकेट्स `[ ]` का उपयोग करके
Solution Breakdown:
-> Unlike C, C++, or Java which use `{ }`, Python enforces consistent indentation (typically 4 spaces) to group statements into blocks and nested blocks. -> Hence, Option (C) is the correct answer.
-> C या Java के विपरीत, पायथन में कोड ब्लॉक बनाने के लिए इंडेंटेशन (स्पेस) का उपयोग किया जाता है। -> इसलिए विकल्प (C) बिल्कुल सही है।
Question 143 NEW
📜 PYQs EASY
Which of the following is NOT a valid rule for naming variables in Python?
पायथन में वेरिएबल का नाम रखने के लिए निम्नलिखित में से कौन सा नियम गलत है?
A
A variable name must start with a letter or an underscore (`_`)
वेरिएबल का नाम किसी अक्षर या अंडरस्कोर (`_`) से शुरू होना चाहिए
B
Variable names are case-insensitive (`age` and `AGE` are the same)
वेरिएबल के नाम केस-इनसेंसिटिव होते हैं (`age` और `AGE` एक ही हैं)
Correct
C
A variable name cannot start with a number
वेरिएबल का नाम किसी संख्या से शुरू नहीं हो सकता
D
A variable name can only contain alphanumeric characters and underscores
वेरिएबल के नाम में केवल अक्षर, अंक और अंडरस्कोर ही हो सकते हैं
Solution Breakdown:
-> Python is strictly case-sensitive, meaning `age`, `Age`, and `AGE` are treated as three completely different variables. -> Hence, Option (B) is the correct answer.
-> पायथन एक केस-सेंसिटिव भाषा है, इसलिए `age`, `Age` और `AGE` तीन अलग-अलग वेरिएबल माने जाते हैं। -> इसलिए विकल्प (B) बिल्कुल सही है।
Question 144 NEW
📜 PYQs EASY
Which keyword is used to define a user-defined function in Python?
पायथन में यूज़र-डिफाइंड फंक्शन को परिभाषित करने के लिए किस कीवर्ड का उपयोग किया जाता है?
A
`def`
`def`
Correct
B
`function`
`function`
C
`func`
`func`
D
`define`
`define`
Solution Breakdown:
-> In Python, a function block always begins with the `def` keyword followed by the function name, parentheses `()`, and a colon `:` (e.g., `def greet():`). -> Hence, Option (A) is the correct answer.
-> पायथन में किसी भी फंक्शन की शुरुआत `def` कीवर्ड से होती है, जिसके बाद फंक्शन का नाम, कोष्ठक और कोलन (`:`) लगाया जाता है। -> इसलिए विकल्प (A) बिल्कुल सही है।
Question 145 NEW
📜 PYQs EASY
Which symbol is used to write a single-line comment in Python?
पायथन में सिंगल-लाइन कमेंट लिखने के लिए किस प्रतीक का उपयोग किया जाता है?
A
`//`
`//`
B
`/*`
`/*`
C
`<!--`
`<!--`
D
`#`
`#`
Correct
Solution Breakdown:
-> In Python, any text following the hash symbol (`#`) on a line is treated as a comment and ignored by the interpreter. -> Note: `//` is used for comments in C++/Java/JS, whereas in Python `//` is the Floor Division operator. -> Hence, Option (D) is the correct answer.
-> पायथन में `#` (हैश) चिह्न के बाद लिखी गई लाइन को कमेंट माना जाता है जिसे इंटरप्रेटर नज़रअंदाज़ कर देता है। -> नोट: पायथन में `//` का उपयोग फ्लोर डिवीज़न के लिए होता है, कमेंट के लिए नहीं। -> इसलिए विकल्प (D) बिल्कुल सही है।
Question 146 NEW
📜 PYQs EASY
How many `>` symbols make up the standard interactive prompt in the Python interpreter (REPL)?
पायथन इंटरप्रेटर के मानक इंटरैक्टिव प्रॉम्प्ट में कितने `>` चिह्न होते हैं?
A
1
1
B
2
2
C
3
3
Correct
D
4
4
Solution Breakdown:
-> The Python interactive shell (REPL – Read-Eval-Print Loop) displays three greater-than signs (`>>>`) to indicate it is ready to accept the next command. -> Hence, Option (C) is the correct answer.
-> पायथन के इंटरैक्टिव प्रॉम्प्ट में तीन `>` चिह्न (`>>>`) होते हैं जो दर्शाते हैं कि इंटरप्रेटर नया कमांड लेने के लिए तैयार है। -> इसलिए विकल्प (C) बिल्कुल सही है।
Question 147 NEW
📜 PYQs EASY
What is the default Integrated Development Environment (IDE) that comes bundled with a standard Python installation?
मानक पायथन इंस्टॉलेशन के साथ डिफ़ॉल्ट रूप से आने वाला इंटीग्रेटेड डेवलपमेंट एनवायरनमेंट कौन सा है?
A
NetBeans
नेटबीन्स
B
IDLE
आईडीएलई
Correct
C
Eclipse
एक्लिप्स
D
DataGrip
डेटाग्रिप
Solution Breakdown:
-> IDLE stands for Integrated Development and Learning Environment. It comes pre-installed with Python and provides both an interactive shell and a script editor. -> Hence, Option (B) is the correct answer.
-> IDLE (इंटीग्रेटेड डेवलपमेंट एंड लर्निंग एनवायरनमेंट) पायथन के साथ आने वाला डिफ़ॉल्ट एडिटर है। -> इसलिए विकल्प (B) बिल्कुल सही है।
Question 148 NEW
📜 PYQs EASY
What is the standard file extension of a Python source code or module file?
पायथन सोर्स कोड या मॉड्यूल फाइल का मानक फाइल एक्सटेंशन क्या होता है?
A
`.py`
`.py`
Correct
B
`.pt`
`.pt`
C
`.python`
`.python`
D
`.txt`
`.txt`
Solution Breakdown:
-> Python scripts and modules are saved with the `.py` extension so the Python interpreter can execute or import them into other programs. -> Hence, Option (A) is the correct answer.
-> पायथन प्रोग्राम और मॉड्यूल फाइलों को `.py` एक्सटेंशन के साथ सेव किया जाता है। -> इसलिए विकल्प (A) बिल्कुल सही है।
Question 149 NEW
📜 PYQs EASY
Which of the following statements is INCORRECT regarding the Python programming language?
पायथन प्रोग्रामिंग भाषा के संबंध में निम्नलिखित में से कौन सा कथन गलत है?
A
It is an interpreted language
यह एक इंटरप्रेटेड भाषा है
B
It supports Object-Oriented Programming
यह ऑब्जेक्ट-ओरिएंटेड प्रोग्रामिंग को सपोर्ट करती है
C
It is a machine-dependent low-level language
यह एक मशीन-डिपेंडेंट लो-लेवल भाषा है
Correct
D
It is a high-level programming language
यह एक हाई-लेवल प्रोग्रामिंग भाषा है
Solution Breakdown:
-> Python is a platform-independent (machine-independent) high-level language; the same Python script can run on Windows, Linux, and macOS wherever a Python interpreter is installed. -> Hence, Option (C) is the correct answer.
-> पायथन एक प्लेटफॉर्म-इंडिपेंडेंट हाई-लेवल भाषा है जो विंडोज़, लिनक्स और मैक सभी पर समान रूप से चल सकती है। -> इसलिए विकल्प (C) बिल्कुल सही है।
Question 150 NEW
📜 PYQs EASY
Who created the Python programming language, which was first released in 1991?
पायथन प्रोग्रामिंग भाषा का विकास किसने किया था, जिसे पहली बार 1991 में रिलीज़ किया गया था?
A
James Gosling
जेम्स गोसलिंग
B
Dennis Ritchie
डेनिस रिची
C
Guido van Rossum
गुइडो वैन रोसुम
Correct
D
Bjarne Stroustrup
ब्योर्न स्ट्राउस्ट्रप
Solution Breakdown:
-> Python was created by Guido van Rossum and first released in 1991. It is a high-level, interpreted, dynamically typed language known for its clean, readable syntax. -> Note: Dennis Ritchie created C, Bjarne Stroustrup created C++, and James Gosling created Java. -> Hence, Option (C) is the correct answer.
-> पायथन का विकास गुइडो वैन रोसुम ने किया था और इसे 1991 में लॉन्च किया गया था। यह अपनी सरल और पढ़ने में आसान सिंटैक्स के लिए प्रसिद्ध है। -> नोट: डेनिस रिची ने C, स्ट्राउस्ट्रप ने C++ और जेम्स गोसलिंग ने Java बनाया था। -> इसलिए विकल्प (C) बिल्कुल सही है।
Prev 4 5 6 7 8 Next
ESSENTIAL STUDY KIT

Master Programming Languages 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!