WorksheetsM3 R5 Test 15
Total questions: 55
Worksheet time: 28mins
Python में टिप्पणी (comment) शुरू करने के लिए कौन-सा चिन्ह इस्तेमाल किया जाता है?
#
//
/*
निम्नलिखित में से कौन-सा एक मान्य Python वेरिएबल नाम है?
2name
name_2
name-2
@name
Python किस प्रकार की प्रोग्रामिंग भाषा का उदाहरण है?
Compiled
Interpreted
Machine-level
Assembly
Python में एक function को परिभाषित (define) करने के लिए कौन-सा कीवर्ड इस्तेमाल किया जाता है?
function
def
define
func
Python में None का डेटा प्रकार क्या है?
Integer
String
NoneType
Boolean
निम्नलिखित में से कौन Python में अपरिवर्तनीय (immutable) है?
List
Dictionary
Tuple
Set
निम्नलिखित कोड का आउटपुट क्या होगा?
6. x = "Hello"
7. print(x[1])
H
e
l
o
Python के लूप में else ब्लॉक का उद्देश्य क्या है?
यह तभी चलता है जब लूप अनंत हो।
यह तभी चलता है जब लूप break के बिना समाप्त होता है।
यह लूप शुरू होने से पहले चलता है।
यह केवल तभी चलता है जब कोई त्रुटि हो।
Python के लूप में else ब्लॉक का उद्देश्य क्या है?
यह तभी चलता है जब लूप अनंत हो।
यह तभी चलता है जब लूप break के बिना समाप्त होता है।
यह लूप शुरू होने से पहले चलता है।
यह केवल तभी चलता है जब कोई त्रुटि हो।
निम्नलिखित कोड का आउटपुट क्या होगा?
for i in range(3):
print(i, end=" ")
1 2 3
0 1 2
1 2
0 1 2 3
किसी function से मान (value) लौटाने के लिए कौन-सा कीवर्ड इस्तेमाल होता है?
return
break
yield
continue
निम्नलिखित कोड का आउटपुट क्या होगा?
def add(a, b=10):
return a + b
print(add(5))
10
15
TypeError
None
Python में अपवाद संभालने (exception handling) के लिए क्या उपयोग किया जाता है?
try-except
if-else
for-while
break-continue
शून्य से संख्या को विभाजित करने पर कौन-सी त्रुटि होती है?
SyntaxError
ValueError
ZeroDivisionError
TypeError
Python में किसी module को कैसे आयात (import) किया जाता है?
import module_name
include module_name
module module_name
require module_name
Python में यादृच्छिक (random) संख्याएँ उत्पन्न करने के लिए कौन-सा module उपयोग किया जाता है?
math
os
random
sys
Python में किसी फाइल को खोलने के लिए कौन-सा फ़ंक्शन उपयोग किया जाता है?
open()
file()
read()
write()
फाइल खोलते समय "r" मोड का क्या तात्पर्य है?
Read-only mode (सिर्फ पढ़ने का मोड)
Write mode (लिखने का मोड)
Append mode (जोड़ने का मोड)
Binary mode (बाइनरी मोड)
किसी फाइल में डेटा लिखने के लिए कौन-सा method उपयोग किया जाता है?
write()
read()
open()
close()
निम्नलिखित कोड क्या करेगा?
f = open("example.txt", "w")
f.write("Hello, World!")
f.close()
एक फाइल example.txt बनाएगा और इसमें "Hello, World!" लिखेगा।
फाइल example.txt को डिलीट कर देगा।
कंसोल पर "Hello, World!" प्रिंट करेगा।
एक त्रुटि उत्पन्न करेगा क्योंकि फाइल मोड गलत है।
Python में एक class क्या है?
ऑब्जेक्ट्स बनाने के लिए एक खाका।
एक प्रकार का वेरिएबल।
Python में एक फ़ंक्शन।
एक आरक्षित कीवर्ड।
किसी class में __init__ method का उद्देश्य क्या है?
ऑब्जेक्ट को बनाते समय उसे initialize करना।
ऑब्जेक्ट को नष्ट करना।
दो संख्याओं को जोड़ना।
ऑब्जेक्ट के प्रकार की जांच करना।
निम्नलिखित में से कौन-सा OOP की विशेषता नहीं है?
Encapsulation
Polymorphism
Inheritance
Compilation
Python में class कैसे बनाई जाती है?
class MyClass:
define class MyClass:
create MyClass()
class = MyClass
Python में lambda कीवर्ड का उद्देश्य क्या है?
गुमनाम (anonymous) फ़ंक्शन बनाने के लिए।
वेरिएबल घोषित करने के लिए।
मॉड्यूल आयात करने के लिए।
multi-line func लिखने के लिए।
गुमनाम (anonymous) फ़ंक्शन बनाने के लिए।
To create anonymous functions.
To declare variables.
To import modules.
To write multi-line functions.
map() फ़ंक्शन क्या करता है?
Executes a specified function for each item in an iterable.
Converts a string to a list.
Finds the maximum value in a list.
Sorts a list in ascending order.
निम्नलिखित कोड का आउटपुट क्या होगा?
x = [1, 2, 3, 4]
result = list(map(lambda n: n * 2, x))
print(result)
[1, 2, 3, 4]
[2, 4, 6, 8]
[1, 4, 9, 16]
[0, 1, 2, 3]
Python में संख्यात्मक गणना (numerical computation) के लिए कौन-सा लाइब्रेरी उपयोग किया जाता है?
os
math
numpy
sys
Python में os मॉड्यूल क्या प्रदान करता है?
Mathematical functions
File and directory handling
String operations
Data visualization
Python में किसी बाहरी लाइब्रेरी को कैसे इंस्टॉल करते हैं?
install library_name
pip install library_name
python install library_name
import library_name
Python में डेटा विज़ुअलाइज़ेशन के लिए कौन-सा लाइब्रेरी उपयोग होता है?
pandas
matplotlib
random
sys
Python में recursion क्या है?
A function that calls itself.
A loop that iterates indefinitely.
A way to define variables.
A type of data type.
recursion में base condition क्या है?
The condition where the recursion ends.
The first line of the recursive function.
The condition where the recursion starts.
None of the above.
निम्नलिखित कोड का आउटपुट क्या होगा?
def factorial(n):
if n == 1:
return 1
else:
return n * factorial(n-1)
print(factorial(4))
24
12
4
None
Python में decorator क्या है?
A function that modifies another function.
A built-in Python module.
A type of loop in Python.
None of the above.
Python में decorator लागू करने के लिए कौन-सा प्रतीक इस्तेमाल किया जाता है?
#
@
$
&
Python में next() फ़ंक्शन का उद्देश्य क्या है?
किसी iterator से अगला आइटम प्राप्त करना।
एक iteration को रोकना।
किसी string को उल्टा करना।
किसी लिस्ट को tuple में बदलना।
Python में generator को परिभाषित करने के लिए कौन-सा कीवर्ड इस्तेमाल किया जाता है?
def
yield
return
continue
thon में generator को परिभाषित करने के लिए कौन-सा कीवर्ड इस्तेमाल किया जाता है?
def
yield
return
continue
Python में 5 ** 2 का परिणाम क्या है?
10
25
20
None
किसी string की लंबाई प्राप्त करने के लिए कौन-सा फ़ंक्शन उपयोग किया जाता है?
size()
len()
length()
str_len()
Python में exception क्या है?
A type of function
An error that occurs during program execution
A warning message
A type of loop
Python में exception को संभालने के लिए कौन-सा ब्लॉक उपयोग किया जाता है?
try
except
Both try and except
error
निम्नलिखित कोड का आउटपुट क्या होगा? try: x = 1 / 0 except ZeroDivisionError: print("Cannot divide by zero")
0
Cannot divide by zero
ZeroDivisionError
No output
Python में finally ब्लॉक का उद्देश्य क्या है?
To execute code regardless of an exception
To terminate the program
To define variables
None of the above
Python में किसी string के भागों को बदलने के लिए कौन-सा method उपयोग किया जाता है?
replace()
find()
update()
edit()
"Hello".upper() का परिणाम क्या है?
hello
HELLO
Hello
Error
Python में strip() method क्या करता है?
string के दोनों सिरों से whitespace हटाता है
string से सभी characters को हटाता है
string को lowercase में बदलता है
उपरोक्त में से कोई नहीं
निम्नलिखित कोड का आउटपुट क्या होगा?
s = "Python"
print(s[1:4])
Pyt
yth
ytho
ytho
Python में किसी loop को समाप्त करने के लिए कौन-सा कीवर्ड उपयोग किया जाता है?
stop
break
exit
terminate
किसी loop में continue statement क्या करता है?
loop को समाप्त करता है
वर्तमान iteration में शेष कोड को छोड़कर अगले iteration पर जाता है
प्रोग्राम को समाप्त करता है
loop को पुनः शुरू करता है
Python में किसी module को आयात करने के लिए कौन-सा कीवर्ड उपयोग किया जाता है?
import
include
require
use
Python में random मॉड्यूल क्या प्रदान करता है?
रैंडम संख्या और अनुक्रम
फाइल हैंडलिंग फ़ंक्शन
स्ट्रिंग संचालन
दिनांक और समय में संशोधन
मॉड्यूल से किसी फ़ंक्शन को कैसे एक्सेस करते हैं?
module_name.function_name
function_name.module_name
module_name:function_name
module_name-function_name
