wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

M3 R5 Test 14

Total questions: 102

Worksheet time: 51mins

Name
Class
Date
1.

यह कोड चलाने पर क्या आउटपुट आएगा? print("Hello, World!")

a)

"Hello, World!"

b)

Hello, World!

c)

print("Hello, World!")

d)

Error

2.

Python में फ़ंक्शन बनाने का सही तरीका क्या है?

a)

def function_name():

b)

create function function_name():

c)

function function_name():

d)

function_name{}

3.

निम्नलिखित में से कौन सा डेटा प्रकार Python में परिवर्तनीय है?

a)

List

b)

Tuple

c)

String

d)

Integer

4.

Python में एक पंक्ति टिप्पणी कैसे लिखी जाती है?

a)

// comment

b)

# comment

c)

-- comment

d)

/* comment */

5.

निम्नलिखित कोड का आउटपुट क्या होगा? x = 10 y = 5 print(x * y)

a)

50

b)

15

c)

5

d)

10

6.

Python में एक सूची कैसे बनाई जाती है?

a)

list = [1, 2, 3]

b)

list = (1, 2, 3)

c)

list = {1, 2, 3}

d)

list = <1, 2, 3>

7.

निम्नलिखित कोड का आउटपुट क्या होगा? x = [1, 2, 3] x.append(4) print(x)

a)

[1, 2, 3]

b)

[1, 2, 3, 4]

c)

Error

d)

[4, 1, 2, 3]

8.

निम्नलिखित में से कौन सा Python फ़ंक्शन सूची की लंबाई प्राप्त करने के लिए प्रयोग किया जाता है?

a)

len()

b)

length()

c)

size()

d)

count()

9.

Python में 'break' स्टेटमेंट क्या करता है?

a)

Breaks the loop entirely

b)

Skips the current iteration

c)

Exits the function

d)

Pauses the program

10.

Python में एक टपल (tuple) कैसे बनाया जाता है?

a)

tuple = (1, 2, 3)

b)

tuple = [1, 2, 3]

c)

tuple = {1, 2, 3}

d)

tuple = <1, 2, 3>

11.

निम्नलिखित में से कौन सा Python में मान्य वेरिएबल नाम नहीं है?

a)

var_name

b)

2var

c)

_var

d)

var2

12.

Python में 'continue' स्टेटमेंट का उद्देश्य क्या है?

a)

Exits the loop

b)

Skips the current iteration and continues to the next one

c)

Pauses the program

d)

Exits the function

13.

Python में डिक्शनरी घोषित करने का कौन सा तरीका सही है?

a)

dict = { 'name': 'John', 'age': 30 }

b)

dict = ( 'name': 'John', 'age': 30 )

c)

dict = [ 'name': 'John', 'age': 30 ]

d)

dict = < 'name': 'John', 'age': 30 >

14.

इस कोड का आउटपुट क्या होगा?

x = 3

y = 5

print(x ** y)

a)

8

b)

15

c)

243

d)

125

15.

निम्नलिखित कोड का आउटपुट क्या होगा?

x = "Python"

print(x[0])

a)

P

b)

y

c)

Error

d)

p

16.

Python में सूची और टपल (tuple) में क्या अंतर है?

a)

List is mutable, tuple is immutable

b)

Tuple is mutable, list is immutable

c)

Both are immutable

d)

Both are mutable

17.

Python में अनुक्रम (sequence) पर पुनरावृत्त (iterate) करने के लिए निम्नलिखित में से कौन सा लूप प्रयोग किया जाता है?

a)

for loop

b)

while loop

c)

do-while loop

d)

foreach loop

18.

Python में एक स्ट्रिंग (string) कैसे शुरू करते हैं?

a)

'Hello'

b)

"Hello"

c)

Both A and B

d)

None

19.

Python में 'pass' स्टेटमेंट क्या करता है?

a)

Skips the execution of code

b)

Marks a function or block of code as "empty"

c)

Exits the loop

d)

Both A and B

20.

Python में अपवादों (exceptions) को संभालने का सही तरीका क्या है?

a)

try - except block

b)

catch - handle block

c)

try - handle block

d)

throw - catch block

21.

निम्नलिखित कोड का आउटपुट क्या होगा?

     x = "Hello"

y = "World

      print(x + " " + y)

a)

Hello World

b)

HelloWorld

c)

Hello + World

d)

Error

22.

Python में उपयोगकर्ता से इनपुट प्राप्त करने के लिए कौन सा फ़ंक्शन उपयोग किया जाता है?

a)

input()

b)

read()

c)

scan()

d)

get()

23.

Python में 'del' स्टेटमेंट क्या करता है?

a)

Deletes a variable or item

b)

Deletes a function

c)

Deletes an object

d)

Deletes a loop

24.

Python में print() फ़ंक्शन के 'sep' पैरामीटर का डिफ़ॉल्ट मान क्या होता है?

a)

" " (Space)

b)

"," (Comma)

c)

"" (Empty string)

d)

None

25.

निम्नलिखित कोड का आउटपुट क्या होगा? x = 3 y = 5 print(x / y)

a)

0.6

b)

0

c)

1

d)

1.5

26.

Python में एक स्ट्रिंग को पूर्णांक (integer) में बदलने के लिए कौन सा फ़ंक्शन उपयोग किया जाता है?

a)

str()

b)

int()

c)

float()

d)

convert()

27.

Python में 'for' लूप में 'else' क्लॉज़ का उद्देश्य क्या है?

a)

Executes when the loop is terminated by a 'break' statement

b)

Executes after the loop completes normally (without a 'break')

c)

Used for error handling in loops

d)

Used to skip the current iteration

28.

निम्नलिखित कोड का आउटपुट क्या होगा? x = "Python" print(x[1:4])

a)

Pyt

b)

yth

c)

ytho

d)

Python

29.

Python में यह कैसे जांचें कि कोई संख्या सम (even) है या विषम (odd)?

a)

if x % 2 == 0:

b)

if x / 2 == 0:

c)

if x // 2 == 1:

d)

if x % 2 != 0:

30.

निम्नलिखित कोड का आउटपुट क्या होगा? x = 10 y = 20 print(x == y)

a)

True

b)

False

c)

1

d)

Error

31.

Python में एक कक्षा (class) को परिभाषित करने के लिए निम्नलिखित में से कौन सा तरीका है?

a)

class MyClass:

b)

class: MyClass

c)

def MyClass:

d)

MyClass = class

32.

निम्नलिखित कोड का आउटपुट क्या होगा? x = 10 if x > 5: print("Greater") else: print("Smaller")

a)

Greater

b)

Smaller

c)

Error

d)

Nothing

33.

Python में सूची (list) से कोई आइटम (item) कैसे हटाएं?

a)

remove()

b)

delete()

c)

pop()

34.

Python में सूची (list) से कोई आइटम (item) कैसे हटाएं?

a)

remove()

b)

delete()

c)

pop()

d)

Both A and C

35.

Python में 'and' ऑपरेटर क्या करता है?

a)

Returns True if both conditions are true

b)

Returns True if at least one condition is true

c)

Always returns False

d)

Compares two variables

36.

निम्नलिखित में से कौन सा Python में त्रुटि (error) उत्पन्न करेगा?

a)

print(5 / 0)

b)

print(5 // 0)

c)

print(5 % 0)

d)

All of the above

37.

Python में एक कक्षा (class) में विधि (method) को परिभाषित करने के लिए निम्नलिखित में से कौन सा तरीका है?

a)

def method_name():

b)

class method_name():

c)

method method_name():

d)

function method_name():

38.

Python में 'self' कीवर्ड का उद्देश्य क्या है?

a)

Refers to the current object of the class

b)

Refers to the parent class

c)

Refers to the current function

d)

Used to define a static method

39.

निम्नलिखित कोड का आउटपुट क्या होगा?

·         x = 7

·         if x < 10:

·             print("Less")

·         elif x == 10:

·             print("Equal")

·         else:

·             print("Greater")

a)

Less

b)

Equal

c)

Greater

d)

Error

40.

Python में 1 से 5 तक संख्याओं की सूची (list) कैसे बनाएं?

a)

list(range(1, 5))

b)

list(range(1, 6))

c)

[1, 5]

d)

[1, 2, 3, 4, 5]

41.

Python में 2 ** 3 का परिणाम क्या होगा?

a)

6

b)

8

c)

9

d)

3

42.

निम्नलिखित कोड का आउटपुट क्या होगा?

·         x = 15

·         y = 4

·         print(x // y)

a)

3

b)

3.75

c)

4

d)

5

43.

लूप में 'break' स्टेटमेंट का उद्देश्य क्या है?

a)

It skips the current iteration and moves to the next iteration

b)

It terminates the loop entirely

c)

It pauses the loop temporarily

d)

It exits the function containing the loop

44.

Python में कक्षा के अंदर एक विधि (method) को परिभाषित करने के लिए कौन सा उपयोग किया जाता है?

a)

def method_name():

b)

function method_name():

c)

method method_name():

d)

class method_name():

45.

Python में कौन सा डेटा संरचना (data structure) क्रमबद्ध (ordered) और अपरिवर्तनीय (immutable) है?

a)

List

b)

Dictionary

c)

Tuple

d)

Set

46.

Python में यह कैसे जांचें कि कोई कुंजी (key) डिक्शनरी (dictionary) में मौजूद है?

a)

key in dict

b)

key in dict.keys()

c)

dict.contains(key)

d)

Both A and B

47.

निम्नलिखित कोड का आउटपुट क्या होगा?

·         x = [1, 2, 3]

·         y = x

·         y[1] = 5

·         print(x)

a)

[1, 5, 3]

b)

[1, 2, 3]

c)

[5, 2, 3]

d)

Error

48.

Python में 'is' ऑपरेटर क्या करता है?

a)

Compares the values of two objects

b)

Compares the identity (memory location) of two objects

c)

Checks if an object is of a specific type

d)

Checks if two variables are equal

49.

निम्नलिखित कोड का आउटपुट क्या होगा?

·         x = 8

·         y = 3

·         print(x % y)

a)

2

b)

5

c)

1

d)

3

50.

Python में एक स्ट्रिंग को लोअरकेस (lowercase) में कैसे बदलें?

a)

str.lower()

b)

str.to_lower()

c)

str.lcase()

d)

str.lowercase()

51.

Python में दो स्ट्रिंग्स को जोड़ने के लिए कौन सा ऑपरेटर उपयोग किया जाता है?

a)

+

b)

&

c)

*

d)

$

52.

निम्नलिखित अभिव्यक्ति का परिणाम क्या होगा?

·         2 * 3 + 4 / 2

a)

8

b)

10

c)

9

d)

11

53.

Python में सेट (set) के बारे में निम्नलिखित में से कौन सा कथन सही है?

a)

Sets are ordered collections of items

b)

Sets do not allow duplicate elements

c)

Sets are mutable but not iterable

d)

Sets allow indexing

54.

निम्नलिखित कोड का आउटपुट क्या होगा?

·         x = 3

·         y = 2

·         print(x ** y)

a)

6

b)

9

c)

8

d)

5

55.

आउटपुट क्या होगा? x = 3 y = 2 print(x ** y)

a)

6

b)

9

c)

8

d)

5

56.

How do you remove an element from a list in Python? Python में सूची (list) से एक तत्व (element) को कैसे हटाएं?

a)

remove()

b)

delete()

c)

pop()

d)

Both A and C

57.

What will the following code print? निम्नलिखित कोड क्या प्रिंट करेगा? x = 10 y = 20 print(x == y)

a)

True

b)

False

c)

10

d)

20

58.

Which of the following methods can be used to add an element at the end of a list? निम्नलिखित में से कौन सा तरीका सूची (list) के अंत में एक तत्व (element) जोड़ने के लिए उपयोग किया जा सकता है?

a)

append()

b)

insert()

c)

add()

d)

extend()

59.

What is the purpose of the 'elif' statement in Python? Python में 'elif' स्टेटमेंट का उद्देश्य क्या है?

a)

It checks another condition if the previous conditions are False

b)

It terminates the if-else block

c)

It executes a block of code unconditionally

d)

It checks if the variable is empty

60.

What is the output of the following code? निम्नलिखित कोड का आउटपुट क्या होगा? x = "OpenAI" y = "ChatGPT" print(x + " " + y)

a)

OpenAI ChatGPT

b)

OpenAIChatGPT

c)

"OpenAI" "ChatGPT"

d)

Error

61.

How do you define a default parameter in a Python function? Python फ़ंक्शन में डिफ़ॉल्ट पैरामीटर (default parameter) कैसे परिभाषित किया जाता है?

a)

def function(param = value):

b)

def function(value = param):

c)

function(param : value)

d)

function(param = value, value2)

62.

Which of the following is the correct way to define a class in Python? Python में कक्षा (class) को परिभाषित करने का सही तरीका कौन सा है?

a)

class MyClass():

b)

class MyClass:

c)

def MyClass():

d)

function MyClass:

63.

What is the output of the following code? निम्नलिखित कोड का आउटपुट क्या होगा? x = 7 y = 3 print(x % y)

a)

4

b)

1

c)

2

d)

0

64.

What is the output of the following code? निम्नलिखित कोड का आउटपुट क्या होगा? x = [1, 2, 3] x.append([4, 5]) print(x)

a)

[1, 2, 3, 4, 5]

b)

[1, 2, 3, [4, 5]]

c)

[4, 5, 1, 2, 3]

d)

Error

65.

Which of the following methods is used to get the last element of a list? निम्नलिखित में से कौन सा तरीका सूची (list) के आखिरी तत्व को प्राप्त करने के लिए उपयोग किया जाता है?

a)

list[-1]

b)

list.last()

c)

list(end)

d)

list.pop()

66.

What does the following code do? निम्नलिखित कोड क्या करता है? x = 3 y = 5 z = 7 print(x < y and z > y)

a)

True

b)

False

c)

Error

d)

None

67.

निम्नलिखित कोड क्या करता है?

·         x = 3

·         y = 5

·         z = 7

·         print(x < y and z > y)

a)

True

b)

False

c)

Error

d)

None

68.

Python में अपवादों (exceptions) को संभालने के लिए कौन सा उपयोग किया जाता है?

a)

try-except block

b)

catch block

c)

handle block

d)

raise block

69.

निम्नलिखित कोड क्या प्रिंट करेगा?

·         x = "Hello"

·         y = "World"

·         print(x * 2 + y)

a)

HelloHelloWorld

b)

HelloWorldHello

c)

HelloWorld

d)

Hello2World

70.

Python में 'continue' स्टेटमेंट क्या करता है?

a)

Skips the current iteration of the loop and continues with the next one

b)

Exits the loop

c)

Pauses the loop

d)

Stops the program execution

71.

Python में print() फ़ंक्शन के 'sep' पैरामीटर का डिफ़ॉल्ट मान क्या है?

a)

, (comma)

b)

(space)

c)

"" (empty string)

d)

None

72.

निम्नलिखित कोड का आउटपुट क्या होगा?

·         x = [1, 2, 3, 4, 5]

·         print(x[:3])

a)

[1, 2, 3]

b)

[2, 3, 4]

c)

[1, 2]

d)

Error

73.

Python में एक वेरिएबल (variable) कैसे घोषित करते हैं?

a)

var_name = value

b)

var value

c)

var(value)

d)

variable = value

74.

Python में इस ऑपरेशन का परिणाम क्या होगा?

·         x = "10"

·         y = 5

print(x + y)

a)

15

b)

Error

c)

10 5

d)

105

75.

Python में 'return' कीवर्ड का उद्देश्य क्या है?

a)

To exit from a function and return a value

b)

To print a value from a function

c)

To break the loop

d)

To define a variable in the function

76.

Python में सूची (list) में से सबसे बड़ा नंबर कैसे ढूंढते हैं?

a)

max()

b)

largest()

c)

sort()

d)

get_max()

77.

निम्नलिखित कोड का परिणाम क्या होगा?

a)

[1, 2, 3]

b)
c)
d)
78.

निम्नलिखित कोड का परिणाम क्या होगा? x = [1, 2, 3] y = x.copy() y[0] = 100 print(x)

a)

[1, 2, 3]

b)

[100, 2, 3]

c)

[1, 2, 100]

d)

Error

79.

Python में दो सूचियों (lists) को जोड़ने का तरीका क्या है?

a)

list1 + list2

b)

list1.append(list2)

c)

list1.extend(list2)

d)

Both A and C

80.

Python में एक सेट (set) बनाने के लिए कौन सा तरीका सही है?

a)

set()

b)

{}

c)

[]

d)

()

81.

निम्नलिखित कोड का आउटपुट क्या होगा? x = "Python" print(x[-1])

a)

P

b)

n

c)

Error

d)

o

82.

Python में निम्नलिखित में से कौन सा एक वैध पहचानकर्ता (identifier) है?

a)

2var

b)

var_2

c)

@var

d)

var@2

83.

निम्नलिखित कोड का आउटपुट क्या होगा? x = {1, 2, 3, 4, 5} x.add(6) print(x)

a)

{1, 2, 3, 4, 5, 6}

b)

{6, 1, 2, 3, 4, 5}

c)

Error

d)

{1, 2, 3, 4, 5}

84.

इस कोड का आउटपुट क्या होगा? x = "Hello" y = "world" print(x + " " + y)

a)

Hello world

b)

HelloWorld

c)

Hello world

d)

Error

85.

निम्नलिखित कोड का आउटपुट क्या होगा? x = 7 y = 3 print(x / y)

a)

2

b)

3

c)

2.33

d)

3.5

86.

Python में डिफ़ॉल्ट आर्ग्युमेंट (default arguments) वाले फ़ंक्शन को कैसे परिभाषित करते हैं?

a)

def func(a=10, b=20):

b)

def func(a, b = 10):

c)

def func(a = 10):

d)

All of the above

87.

निम्नलिखित कोड का आउटपुट क्या होगा? x = [1, 2, 3] x.remove(2) print(x)

a)

[1, 2, 3]

b)

[1, 3]

c)

[2, 3]

d)

Error

88.

Python में एक खाली डिक्शनरी (dictionary) को परिभाषित करने के लिए निम्नलिखित में से कौन सा तरीका है?

a)

{}

b)

[]

c)

()

d)

None

89.

निम्नलिखित कोड का आउटपुट क्या होगा? x = 10 y = 5 x += y print(x)

a)

5

b)

15

c)

10

d)

Error

90.

निम्नलिखित कोड का आउटपुट क्या होगा? x = "Python" print(x[1:4])

a)

Pyt

b)

yth

c)

ytho

d)

Python

91.

x = "Python" print(x[1:4]) क्या होगा?

a)

Pyt

b)

yth

c)

ytho

d)

Python

92.

Python में एक मॉड्यूल (module) को इंपोर्ट (import) करने के लिए कौन सा तरीका है?

a)

import module_name

b)

include module_name

c)

require module_name

d)

use module_name

93.

Python में एक वेरिएबल (variable) के प्रकार (type) की जांच करने के लिए कौन सा तरीका है?

a)

type()

b)

typeof()

c)

check_type()

d)

type_of()

94.

निम्नलिखित कोड का आउटपुट क्या होगा? x = "abc" print(x.upper())

a)

ABC

b)

abc

c)

Abc

d)

Error

95.

Python में एक सूची (list) पर इटरेट (iterate) करने के लिए कौन सा तरीका उपयोग किया जा सकता है?

a)

for loop

b)

while loop

c)

list comprehension

d)

All of the above

96.

निम्नलिखित कोड का परिणाम क्या होगा? x = 5 y = 3 print(x == y)

a)

True

b)

False

c)

Error

d)

None

97.

निम्नलिखित कोड का आउटपुट क्या होगा? x = 3 y = 2 z = 4 print(x == y or z > y)

a)

True

b)

False

c)

Error

d)

None

98.

Python में 'pass' स्टेटमेंट का उद्देश्य क्या है?

a)

To skip the current iteration of the loop

b)

To create an empty function or class

c)

To terminate a function

d)

To pause the program

99.

निम्नलिखित कोड का आउटपुट क्या होगा? x = 7 if x > 10: print("Greater") else: print("Smaller")

a)

Greater

b)

Smaller

c)

Error

d)

Nothing

100.

Python में एक वेरिएबल (variable) को कैसे परिभाषित करते हैं?

a)

var_name = value

b)

variable:value

c)

variable(value)

d)

var_name : value

101.

निम्नलिखित कोड का आउटपुट क्या होगा? x = [1, 2, 3] y = x y[0] = 10 print(x)

a)

[10, 2, 3]

b)

[1, 2, 3]

c)

[10, 1, 3]

d)

Error

102.

Python में एक फ़ंक्शन (function) को कैसे परिभाषित करते हैं?

a)

def function_name():

b)

function function_name():

c)

def function_name:

d)

func function_name():