Font size
WorksheetsM3 R5 Test 14
Total questions: 102
Worksheet time: 51mins
यह कोड चलाने पर क्या आउटपुट आएगा? print("Hello, World!")
"Hello, World!"
Hello, World!
print("Hello, World!")
Error
Python में फ़ंक्शन बनाने का सही तरीका क्या है?
def function_name():
create function function_name():
function function_name():
function_name{}
निम्नलिखित में से कौन सा डेटा प्रकार Python में परिवर्तनीय है?
List
Tuple
String
Integer
Python में एक पंक्ति टिप्पणी कैसे लिखी जाती है?
// comment
# comment
-- comment
/* comment */
निम्नलिखित कोड का आउटपुट क्या होगा? x = 10 y = 5 print(x * y)
50
15
5
10
Python में एक सूची कैसे बनाई जाती है?
list = [1, 2, 3]
list = (1, 2, 3)
list = {1, 2, 3}
list = <1, 2, 3>
निम्नलिखित कोड का आउटपुट क्या होगा? x = [1, 2, 3] x.append(4) print(x)
[1, 2, 3]
[1, 2, 3, 4]
Error
[4, 1, 2, 3]
निम्नलिखित में से कौन सा Python फ़ंक्शन सूची की लंबाई प्राप्त करने के लिए प्रयोग किया जाता है?
len()
length()
size()
count()
Python में 'break' स्टेटमेंट क्या करता है?
Breaks the loop entirely
Skips the current iteration
Exits the function
Pauses the program
Python में एक टपल (tuple) कैसे बनाया जाता है?
tuple = (1, 2, 3)
tuple = [1, 2, 3]
tuple = {1, 2, 3}
tuple = <1, 2, 3>
निम्नलिखित में से कौन सा Python में मान्य वेरिएबल नाम नहीं है?
var_name
2var
_var
var2
Python में 'continue' स्टेटमेंट का उद्देश्य क्या है?
Exits the loop
Skips the current iteration and continues to the next one
Pauses the program
Exits the function
Python में डिक्शनरी घोषित करने का कौन सा तरीका सही है?
dict = { 'name': 'John', 'age': 30 }
dict = ( 'name': 'John', 'age': 30 )
dict = [ 'name': 'John', 'age': 30 ]
dict = < 'name': 'John', 'age': 30 >
इस कोड का आउटपुट क्या होगा?
x = 3
y = 5
print(x ** y)
8
15
243
125
निम्नलिखित कोड का आउटपुट क्या होगा?
x = "Python"
print(x[0])
P
y
Error
p
Python में सूची और टपल (tuple) में क्या अंतर है?
List is mutable, tuple is immutable
Tuple is mutable, list is immutable
Both are immutable
Both are mutable
Python में अनुक्रम (sequence) पर पुनरावृत्त (iterate) करने के लिए निम्नलिखित में से कौन सा लूप प्रयोग किया जाता है?
for loop
while loop
do-while loop
foreach loop
Python में एक स्ट्रिंग (string) कैसे शुरू करते हैं?
'Hello'
"Hello"
Both A and B
None
Python में 'pass' स्टेटमेंट क्या करता है?
Skips the execution of code
Marks a function or block of code as "empty"
Exits the loop
Both A and B
Python में अपवादों (exceptions) को संभालने का सही तरीका क्या है?
try - except block
catch - handle block
try - handle block
throw - catch block
निम्नलिखित कोड का आउटपुट क्या होगा?
x = "Hello"
y = "World
print(x + " " + y)
Hello World
HelloWorld
Hello + World
Error
Python में उपयोगकर्ता से इनपुट प्राप्त करने के लिए कौन सा फ़ंक्शन उपयोग किया जाता है?
input()
read()
scan()
get()
Python में 'del' स्टेटमेंट क्या करता है?
Deletes a variable or item
Deletes a function
Deletes an object
Deletes a loop
Python में print() फ़ंक्शन के 'sep' पैरामीटर का डिफ़ॉल्ट मान क्या होता है?
" " (Space)
"," (Comma)
"" (Empty string)
None
निम्नलिखित कोड का आउटपुट क्या होगा? x = 3 y = 5 print(x / y)
0.6
0
1
1.5
Python में एक स्ट्रिंग को पूर्णांक (integer) में बदलने के लिए कौन सा फ़ंक्शन उपयोग किया जाता है?
str()
int()
float()
convert()
Python में 'for' लूप में 'else' क्लॉज़ का उद्देश्य क्या है?
Executes when the loop is terminated by a 'break' statement
Executes after the loop completes normally (without a 'break')
Used for error handling in loops
Used to skip the current iteration
निम्नलिखित कोड का आउटपुट क्या होगा? x = "Python" print(x[1:4])
Pyt
yth
ytho
Python
Python में यह कैसे जांचें कि कोई संख्या सम (even) है या विषम (odd)?
if x % 2 == 0:
if x / 2 == 0:
if x // 2 == 1:
if x % 2 != 0:
निम्नलिखित कोड का आउटपुट क्या होगा? x = 10 y = 20 print(x == y)
True
False
1
Error
Python में एक कक्षा (class) को परिभाषित करने के लिए निम्नलिखित में से कौन सा तरीका है?
class MyClass:
class: MyClass
def MyClass:
MyClass = class
निम्नलिखित कोड का आउटपुट क्या होगा? x = 10 if x > 5: print("Greater") else: print("Smaller")
Greater
Smaller
Error
Nothing
Python में सूची (list) से कोई आइटम (item) कैसे हटाएं?
remove()
delete()
pop()
Python में सूची (list) से कोई आइटम (item) कैसे हटाएं?
remove()
delete()
pop()
Both A and C
Python में 'and' ऑपरेटर क्या करता है?
Returns True if both conditions are true
Returns True if at least one condition is true
Always returns False
Compares two variables
निम्नलिखित में से कौन सा Python में त्रुटि (error) उत्पन्न करेगा?
print(5 / 0)
print(5 // 0)
print(5 % 0)
All of the above
Python में एक कक्षा (class) में विधि (method) को परिभाषित करने के लिए निम्नलिखित में से कौन सा तरीका है?
def method_name():
class method_name():
method method_name():
function method_name():
Python में 'self' कीवर्ड का उद्देश्य क्या है?
Refers to the current object of the class
Refers to the parent class
Refers to the current function
Used to define a static method
निम्नलिखित कोड का आउटपुट क्या होगा?
· x = 7
· if x < 10:
· print("Less")
· elif x == 10:
· print("Equal")
· else:
· print("Greater")
Less
Equal
Greater
Error
Python में 1 से 5 तक संख्याओं की सूची (list) कैसे बनाएं?
list(range(1, 5))
list(range(1, 6))
[1, 5]
[1, 2, 3, 4, 5]
Python में 2 ** 3 का परिणाम क्या होगा?
6
8
9
3
निम्नलिखित कोड का आउटपुट क्या होगा?
· x = 15
· y = 4
· print(x // y)
3
3.75
4
5
लूप में 'break' स्टेटमेंट का उद्देश्य क्या है?
It skips the current iteration and moves to the next iteration
It terminates the loop entirely
It pauses the loop temporarily
It exits the function containing the loop
Python में कक्षा के अंदर एक विधि (method) को परिभाषित करने के लिए कौन सा उपयोग किया जाता है?
def method_name():
function method_name():
method method_name():
class method_name():
Python में कौन सा डेटा संरचना (data structure) क्रमबद्ध (ordered) और अपरिवर्तनीय (immutable) है?
List
Dictionary
Tuple
Set
Python में यह कैसे जांचें कि कोई कुंजी (key) डिक्शनरी (dictionary) में मौजूद है?
key in dict
key in dict.keys()
dict.contains(key)
Both A and B
निम्नलिखित कोड का आउटपुट क्या होगा?
· x = [1, 2, 3]
· y = x
· y[1] = 5
· print(x)
[1, 5, 3]
[1, 2, 3]
[5, 2, 3]
Error
Python में 'is' ऑपरेटर क्या करता है?
Compares the values of two objects
Compares the identity (memory location) of two objects
Checks if an object is of a specific type
Checks if two variables are equal
निम्नलिखित कोड का आउटपुट क्या होगा?
· x = 8
· y = 3
· print(x % y)
2
5
1
3
Python में एक स्ट्रिंग को लोअरकेस (lowercase) में कैसे बदलें?
str.lower()
str.to_lower()
str.lcase()
str.lowercase()
Python में दो स्ट्रिंग्स को जोड़ने के लिए कौन सा ऑपरेटर उपयोग किया जाता है?
+
&
*
$
निम्नलिखित अभिव्यक्ति का परिणाम क्या होगा?
· 2 * 3 + 4 / 2
8
10
9
11
Python में सेट (set) के बारे में निम्नलिखित में से कौन सा कथन सही है?
Sets are ordered collections of items
Sets do not allow duplicate elements
Sets are mutable but not iterable
Sets allow indexing
निम्नलिखित कोड का आउटपुट क्या होगा?
· x = 3
· y = 2
· print(x ** y)
6
9
8
5
आउटपुट क्या होगा? x = 3 y = 2 print(x ** y)
6
9
8
5
How do you remove an element from a list in Python? Python में सूची (list) से एक तत्व (element) को कैसे हटाएं?
remove()
delete()
pop()
Both A and C
What will the following code print? निम्नलिखित कोड क्या प्रिंट करेगा? x = 10 y = 20 print(x == y)
True
False
10
20
Which of the following methods can be used to add an element at the end of a list? निम्नलिखित में से कौन सा तरीका सूची (list) के अंत में एक तत्व (element) जोड़ने के लिए उपयोग किया जा सकता है?
append()
insert()
add()
extend()
What is the purpose of the 'elif' statement in Python? Python में 'elif' स्टेटमेंट का उद्देश्य क्या है?
It checks another condition if the previous conditions are False
It terminates the if-else block
It executes a block of code unconditionally
It checks if the variable is empty
What is the output of the following code? निम्नलिखित कोड का आउटपुट क्या होगा? x = "OpenAI" y = "ChatGPT" print(x + " " + y)
OpenAI ChatGPT
OpenAIChatGPT
"OpenAI" "ChatGPT"
Error
How do you define a default parameter in a Python function? Python फ़ंक्शन में डिफ़ॉल्ट पैरामीटर (default parameter) कैसे परिभाषित किया जाता है?
def function(param = value):
def function(value = param):
function(param : value)
function(param = value, value2)
Which of the following is the correct way to define a class in Python? Python में कक्षा (class) को परिभाषित करने का सही तरीका कौन सा है?
class MyClass():
class MyClass:
def MyClass():
function MyClass:
What is the output of the following code? निम्नलिखित कोड का आउटपुट क्या होगा? x = 7 y = 3 print(x % y)
4
1
2
0
What is the output of the following code? निम्नलिखित कोड का आउटपुट क्या होगा? x = [1, 2, 3] x.append([4, 5]) print(x)
[1, 2, 3, 4, 5]
[1, 2, 3, [4, 5]]
[4, 5, 1, 2, 3]
Error
Which of the following methods is used to get the last element of a list? निम्नलिखित में से कौन सा तरीका सूची (list) के आखिरी तत्व को प्राप्त करने के लिए उपयोग किया जाता है?
list[-1]
list.last()
list(end)
list.pop()
What does the following code do? निम्नलिखित कोड क्या करता है? x = 3 y = 5 z = 7 print(x < y and z > y)
True
False
Error
None
निम्नलिखित कोड क्या करता है?
· x = 3
· y = 5
· z = 7
· print(x < y and z > y)
True
False
Error
None
Python में अपवादों (exceptions) को संभालने के लिए कौन सा उपयोग किया जाता है?
try-except block
catch block
handle block
raise block
निम्नलिखित कोड क्या प्रिंट करेगा?
· x = "Hello"
· y = "World"
· print(x * 2 + y)
HelloHelloWorld
HelloWorldHello
HelloWorld
Hello2World
Python में 'continue' स्टेटमेंट क्या करता है?
Skips the current iteration of the loop and continues with the next one
Exits the loop
Pauses the loop
Stops the program execution
Python में print() फ़ंक्शन के 'sep' पैरामीटर का डिफ़ॉल्ट मान क्या है?
, (comma)
(space)
"" (empty string)
None
निम्नलिखित कोड का आउटपुट क्या होगा?
· x = [1, 2, 3, 4, 5]
· print(x[:3])
[1, 2, 3]
[2, 3, 4]
[1, 2]
Error
Python में एक वेरिएबल (variable) कैसे घोषित करते हैं?
var_name = value
var value
var(value)
variable = value
Python में इस ऑपरेशन का परिणाम क्या होगा?
· x = "10"
· y = 5
print(x + y)
15
Error
10 5
105
Python में 'return' कीवर्ड का उद्देश्य क्या है?
To exit from a function and return a value
To print a value from a function
To break the loop
To define a variable in the function
Python में सूची (list) में से सबसे बड़ा नंबर कैसे ढूंढते हैं?
max()
largest()
sort()
get_max()
निम्नलिखित कोड का परिणाम क्या होगा?
[1, 2, 3]
निम्नलिखित कोड का परिणाम क्या होगा? x = [1, 2, 3] y = x.copy() y[0] = 100 print(x)
[1, 2, 3]
[100, 2, 3]
[1, 2, 100]
Error
Python में दो सूचियों (lists) को जोड़ने का तरीका क्या है?
list1 + list2
list1.append(list2)
list1.extend(list2)
Both A and C
Python में एक सेट (set) बनाने के लिए कौन सा तरीका सही है?
set()
{}
[]
()
निम्नलिखित कोड का आउटपुट क्या होगा? x = "Python" print(x[-1])
P
n
Error
o
Python में निम्नलिखित में से कौन सा एक वैध पहचानकर्ता (identifier) है?
2var
var_2
@var
var@2
निम्नलिखित कोड का आउटपुट क्या होगा? x = {1, 2, 3, 4, 5} x.add(6) print(x)
{1, 2, 3, 4, 5, 6}
{6, 1, 2, 3, 4, 5}
Error
{1, 2, 3, 4, 5}
इस कोड का आउटपुट क्या होगा? x = "Hello" y = "world" print(x + " " + y)
Hello world
HelloWorld
Hello world
Error
निम्नलिखित कोड का आउटपुट क्या होगा? x = 7 y = 3 print(x / y)
2
3
2.33
3.5
Python में डिफ़ॉल्ट आर्ग्युमेंट (default arguments) वाले फ़ंक्शन को कैसे परिभाषित करते हैं?
def func(a=10, b=20):
def func(a, b = 10):
def func(a = 10):
All of the above
निम्नलिखित कोड का आउटपुट क्या होगा? x = [1, 2, 3] x.remove(2) print(x)
[1, 2, 3]
[1, 3]
[2, 3]
Error
Python में एक खाली डिक्शनरी (dictionary) को परिभाषित करने के लिए निम्नलिखित में से कौन सा तरीका है?
{}
[]
()
None
निम्नलिखित कोड का आउटपुट क्या होगा? x = 10 y = 5 x += y print(x)
5
15
10
Error
निम्नलिखित कोड का आउटपुट क्या होगा? x = "Python" print(x[1:4])
Pyt
yth
ytho
Python
x = "Python" print(x[1:4]) क्या होगा?
Pyt
yth
ytho
Python
Python में एक मॉड्यूल (module) को इंपोर्ट (import) करने के लिए कौन सा तरीका है?
import module_name
include module_name
require module_name
use module_name
Python में एक वेरिएबल (variable) के प्रकार (type) की जांच करने के लिए कौन सा तरीका है?
type()
typeof()
check_type()
type_of()
निम्नलिखित कोड का आउटपुट क्या होगा? x = "abc" print(x.upper())
ABC
abc
Abc
Error
Python में एक सूची (list) पर इटरेट (iterate) करने के लिए कौन सा तरीका उपयोग किया जा सकता है?
for loop
while loop
list comprehension
All of the above
निम्नलिखित कोड का परिणाम क्या होगा? x = 5 y = 3 print(x == y)
True
False
Error
None
निम्नलिखित कोड का आउटपुट क्या होगा? x = 3 y = 2 z = 4 print(x == y or z > y)
True
False
Error
None
Python में 'pass' स्टेटमेंट का उद्देश्य क्या है?
To skip the current iteration of the loop
To create an empty function or class
To terminate a function
To pause the program
निम्नलिखित कोड का आउटपुट क्या होगा? x = 7 if x > 10: print("Greater") else: print("Smaller")
Greater
Smaller
Error
Nothing
Python में एक वेरिएबल (variable) को कैसे परिभाषित करते हैं?
var_name = value
variable:value
variable(value)
var_name : value
निम्नलिखित कोड का आउटपुट क्या होगा? x = [1, 2, 3] y = x y[0] = 10 print(x)
[10, 2, 3]
[1, 2, 3]
[10, 1, 3]
Error
Python में एक फ़ंक्शन (function) को कैसे परिभाषित करते हैं?
def function_name():
function function_name():
def function_name:
func function_name():
