wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

M3 R5 Chapter 6

Total questions: 105

Worksheet time: 53mins

Name
Class
Date
1.

Python में function को define करने के लिए कौन सा keyword उपयोग किया जाता है?

a)

def

b)

func

c)

define

d)

lambda

2.

Function का उपयोग क्यों किया जाता है?

a)

To organize code into reusable blocks

b)

To reduce performance

c)

To increase memory usage

d)

To handle exceptions

3.

Top-down approach किस पर आधारित है?

a)

Breaking problems into smaller, manageable components

b)

Combining multiple small problems into one

c)

Ignoring the details of a problem

d)

Testing all solutions simultaneously

4.

Top-down approach का मुख्य लाभ क्या है?

a)

Simplifies debugging and implementation

b)

Reduces code readability

c)

Removes modularity

d)

Decreases team collaboration

5.

Modular programming का मुख्य उद्देश्य क्या है?

a)

To create independent, reusable code modules

b)

To increase dependency between modules

c)

To execute programs faster

d)

To avoid using functions

6.

Modular programming का एक उदाहरण क्या है?

a)

Dividing code into separate functions or classes

b)

Writing everything in a single file

c)

Using global variables only

d)

Ignoring code reusability

7.

Python में variable को declare करने के लिए कौन सा syntax सही है?

a)

x = 10

b)

int x = 10

c)

var x = 10

d)

declare x = 10

8.

Python में variable को dynamically type क्यों कहा जाता है?

a)

Because they can change type during runtime

b)

Because their names can change

c)

Because they are declared using var

d)

Because they cannot store strings

9.

Docstring लिखने के लिए कौन सा symbol उपयोग होता है?

a)

Triple quotes ("")

b)

Double quotes (")

c)

Hash symbol (#)

d)

Single quotes (')

10.

Function में docstring का उपयोग क्यों किया जाता है?

a)

To provide documentation for the function

b)

To execute the function

c)

To comment out the function

d)

To define global variables

11.

Python में global variable को modify करने के लिए कौन सा keyword उपयोग होता है?

a)

global

b)

nonlocal

c)

static

d)

const

12.

Global variables का मुख्य नुकसान क्या है?

a)

They can be accessed and modified from anywhere, leading to unintended side effects

b)

They are not accessible outside the function

c)

They cannot store strings

d)

They are slow to execute

13.

Positional arguments कैसे पास किए जाते हैं?

a)

In the order they are defined

b)

In reverse order

c)

Randomly

d)

Using keyword-value pairs

14.

Positional arguments के साथ error कब आती है?

a)

When the number of arguments does not match the function definition

b)

When arguments are passed as keywords

c)

When arguments are all integers

d)

When arguments are default values

15.

Python में math library का उपयोग किसके लिए किया जाता है?

a)

To perform mathematical operations

b)

To manipulate strings

c)

To manage files

d)

To create user interfaces

16.

random library का उपयोग क्यों किया जाता है?

a)

To generate random numbers

b)

To sort numbers

c)

To access global variables

d)

To create static variables

17.

Python में string को uppercase में बदलने के लिए कौन सी method उपयोग होती है?

a)

upper()

b)

lower()

c)

capitalize()

d)

title()

18.

String में substring की position find करने के लिए कौन सी method उपयोग होती है?

a)

find()

b)

index()

c)

Both A and B

d)

replace()

19.

Slicing syntax में कौन सा range शामिल होता है?

a)

Start index to (end index - 1)

b)

Start index to end index

c)

Start index to end of the string

d)

Entire string

20.

Python में membership operator कौन सा है?

a)

in

b)

is

c)

not

d)

and

21.

Python में absolute value पाने के लिए कौन सी function उपयोग होती है?

a)

abs()

b)

round()

c)

ceil()

d)

floor()

22.

Python में किसी संख्या को round करने के लिए कौन सी function उपयोग की जाती है?

a)

round()

b)

floor()

c)

abs()

d)

ceil()

23.

Python में current date और time प्राप्त करने के लिए कौन सा module उपयोग होता है?

a)

datetime

b)

time

c)

calendar

d)

dateutils

24.

Python में datetime.now() method का उपयोग किसके लिए किया जाता है?

a)

To get the current date and time

b)

To calculate time intervals

c)

To set alarms

d)

To retrieve past dates

25.

Recursion का मुख्य लाभ क्या है?

a)

Simplifies code for problems like factorial and Fibonacci series

b)

Speeds up program execution

c)

Uses less memory

d)

Avoids stack overflow

26.

Recursion के कारण stack overflow कब होता है?

a)

When the base case is not defined

b)

When the function is called with the wrong parameters

c)

When recursion is not used

d)

When too many global variables are defined

27.

Python में string slicing का syntax क्या है?

a)

string[start:end:step]

b)

string[start:end]

c)

string[start]

d)

Both A and B

28.

Python में string की membership चेक करने के लिए कौन सा operator उपयोग होता है?

a)

in

b)

is

c)

==

d)

!=

29.

Python में pattern matching के लिए कौन सा module उपयोग होता है?

a)

re

b)

regex

c)

match

d)

string

30.

सा module उपयोग होता है?

a)

re

b)

regex

c)

match

d)

string

31.

Python में regex pattern को match करने के लिए कौन सी method उपयोग होती है?

a)

match()

b)

find()

c)

search()

d)

Both A and C

32.

Python में default arguments को define करने का syntax क्या है?

a)

def func(x=5):

b)

def func(x:5):

c)

def func(int x=5):

d)

def func(x=>5):

33.

Default arguments कब उपयोग होते हैं?

a)

When no value is passed for that parameter

b)

When all parameters are integers

c)

When the function has no return value

d)

When the function is recursive

34.

Python में random number generate करने के लिए कौन सी function उपयोग की जाती है?

a)

random.randint()

b)

random.random()

c)

Both A and B

d)

random.shuffle()

35.

Python में math.sqrt() function का उपयोग क्यों किया जाता है?

a)

To calculate the square root of a number

b)

To calculate the square of a number

c)

To generate random numbers

d)

To find the absolute value

36.

Python में function की docstring को retrieve करने के लिए कौन सी attribute उपयोग की जाती है?

a)

__doc__

b)

__str__

c)

__dict__

d)

__help__

37.

Docstring का प्राथमिक उद्देश्य क्या है?

a)

To describe the purpose and functionality of a function

b)

To debug a program

c)

To calculate the return value

d)

To optimize the function

38.

Python में string को split करने के लिए कौन सी method उपयोग होती है?

a)

split()

b)

partition()

c)

join()

d)

replace()

39.

Python में string को replace करने के लिए कौन सी method उपयोग होती है?

a)

replace()

b)

sub()

c)

re.sub()

d)

split()

40.

Recursion में base case का क्या महत्व है?

a)

It terminates the recursive calls to avoid infinite loops.

b)

It increases the number of recursive calls.

c)

It slows down the program.

d)

It uses less memory.

41.

Python में recursion का उपयोग कब उचित होता है?

a)

When solving problems that can be divided into smaller sub-problems.

b)

When dealing with non-repeating tasks.

c)

When the base case cannot be defined.

d)

When you want to avoid stack overflow.

42.

Python में किसी संख्या के square root की गणना करने के लिए कौन सा function उपयोग होता है?

a)

math.sqrt()

b)

math.pow()

c)

round()

d)

abs()

43.

math.pow(x, y) का आउटपुट क्या होता है?

a)

The value of xyx^y

b)

The square root of x

c)

The absolute value of x

d)

The remainder when x is divided by y

44.

Python में string slicing में step parameter क्या दर्शाता है?

a)

The interval between indices to pick characters

b)

The length of the string

c)

The ending ind

45.

में step parameter क्या दर्शाता है?

a)

A. The interval between indices to pick characters

b)

B. The length of the string

c)

C. The ending index

d)

D. The starting index

46.

s = "Python" का s[::2] का आउटपुट क्या होगा?

a)

A. Pto

b)

B. Pytho

c)

C. Pon

d)

D. Pyt

47.

Python में regex pattern को compile करने के लिए कौन सा function उपयोग होता है?

a)

A. re.compile()

b)

B. re.match()

c)

C. re.search()

d)

D. re.findall()

48.

re.findall() method का उपयोग किसके लिए होता है?

a)

A. To find all non-overlapping matches of a pattern in a string

b)

B. To return only the first match

c)

C. To replace patterns in a string

d)

D. To compile regex patterns

49.

Python में current year प्राप्त करने के लिए कौन सी method उपयोग होती है?

a)

A. datetime.now().year

b)

B. datetime.today().year

c)

C. date.today().year

d)

D. datetime.now().today()

50.

time.sleep() function का उपयोग क्यों किया जाता है?

a)

A. To pause the execution of the program for a specified duration

b)

B. To measure the execution time

c)

C. To set an alarm

d)

D. To retrieve the system time

51.

Keyword arguments का उपयोग कब किया जाता है?

a)

A. When arguments are passed with their parameter names

b)

B. When arguments are passed in sequential order

c)

C. When default values are ignored

d)

D. When positional arguments are not used

52.

Python में positional और keyword arguments को mix करने पर error कब आती है?

a)

A. When a positional argument is given after a keyword argument

b)

B. When all arguments are positional

c)

C. When all arguments are keywords

d)

D. When default arguments are used

53.

Python किस प्रकार के functions को support करता है?

a)

A. Built-in and User-defined

b)

B. Static and Global

c)

C. Inline and Recursive

d)

D. Anonymous and Predefined

54.

User-defined functions को define करने के लिए Python में कौन सा keyword उपयोग होता है?

a)

A. def

b)

B. define

c)

C. func

d)

D. lambda

55.

Python में docstring को लिखने के लिए कौन सा symbol उपयोग होता है?

a)

A. Triple quotes ("")

b)

B. Single quotes (')

c)

C. Hash symbol (#)

d)

D. Double quotes (")

56.

Function docstring में क्या जानकारी होती है?

a)

A. Purpose of the function

b)

B. Function's arguments and return values

c)

C. Examples of usage

d)

D. All of the above

57.

Function में कितने levels की depth allow की जाती है?

a)

A. No specific limit (depends on system's stack limit)

b)

B. 100 levels

c)

C. 10 levels

d)

D. 50 levels

58.

Recursive functions को depth limit से बचाने के लिए क्या उपयोग होता है?

a)

A. Base case

b)

B. Global variables

c)

C. Default parameters

d)

D. Overloading

59.

s को depth limit से बचाने के लिए क्या उपयोग होता है?

a)

Base case

b)

Global variables

c)

Default parameters

d)

Overloading

60.

Function का primary use क्या है?

a)

Code reuse and modularity

b)

To make the code slower

c)

To reduce debugging

d)

To increase dependencies

61.

Python में function को call करने के लिए कौन सा syntax सही है?

a)

function_name()

b)

call function_name

c)

execute function_name

d)

function_name.run()

62.

Python में string को lowercase में बदलने के लिए कौन सी method उपयोग होती है?

a)

lower()

b)

upper()

c)

swapcase()

d)

title()

63.

upper() method का output क्या होगा अगर input "hello" हो?

a)

HELLO

b)

hello

c)

Hello

d)

hELLO

64.

swapcase() method का उपयोग किस लिए किया जाता है?

a)

To swap uppercase to lowercase and vice versa

b)

To capitalize the string

c)

To reverse the string

d)

To split the string

65.

islower() method कब True return करता है?

a)

When all characters in the string are lowercase

b)

When all characters in the string are uppercase

c)

When the string is empty

d)

When the string contains numbers

66.

Random numbers generate करने के लिए कौन सा module उपयोग होता है?

a)

random

b)

math

c)

time

d)

sys

67.

random.randint(1, 10) का output क्या हो सकता है?

a)

Any integer between 1 and 10 (inclusive)

b)

Any number between 1 and 10 (exclusive)

c)

Only 1 or 10

d)

Only integers greater than 10

68.

Python में random floating-point numbers generate करने के लिए कौन सी method उपयोग होती है?

a)

random.uniform()

b)

random.randint()

c)

random.sample()

d)

random.shuffle()

69.

Python में math.ceil() का उपयोग क्या करता है?

a)

Returns the smallest integer greater than or equal to the given number

b)

Returns the largest integer less than or equal to the given number

c)

Returns the square root of the number

d)

Rounds the number to the nearest integer

70.

math.sqrt(16) का output क्या होगा?

a)

4.0

b)

8.0

c)

16.0

d)

2.0

71.

ceil() और floor() में क्या अंतर है?

a)

ceil() rounds up, while floor() rounds down.

b)

ceil() rounds down, while floor() rounds up.

c)

Both perform the same function.

d)

ceil() works only with integers.

72.

math.ceil(4.2) का output क्या होगा?

a)

5

b)

4

c)

4.0

d)

5.0

73.

Python में math.sqrt() negative numbers के साथ क्या return करता है?

a)

Error

b)

Zero

c)

Negative square root

d)

Positive square root

74.

Built-in functions में से कौन सा Python का function है?

a)

print()

b)

sum()

c)

len

75.

Built-in functions में से कौन सा Python का function है?

a)

print()

b)

sum()

c)

len()

d)

All of the above

76.

User-defined functions में arguments को कैसे पास किया जाता है?

a)

By specifying them in parentheses during the function call

b)

By using the return statement

c)

By declaring them globally

d)

By writing them after the function definition

77.

Multi-line docstring को लिखने के लिए सही syntax क्या है?

a)

""" This is a multi-line docstring """

b)

''' This is a multi-line docstring '''

c)

Both A and B

d)

None of the above

78.

Docstring का मुख्य उद्देश्य क्या है?

a)

To document code for better understanding

b)

To run the function automatically

c)

To import libraries

d)

To debug the code

79.

Functions में parameters के उपयोग का क्या लाभ है?

a)

They allow data to be passed into the function.

b)

They make functions independent of external variables.

c)

They increase modularity.

d)

All of the above

80.

Recursive function में recursion depth को किससे control किया जा सकता है?

a)

Using a base case

b)

Using global variables

c)

Using a loop

d)

Using a lambda function

81.

"HELLO".lower() का output क्या होगा?

a)

hello

b)

HELLO

c)

Hello

d)

Error

82.

"python".isupper() method का output क्या return करेगा?

a)

False

b)

True

c)

None

d)

Error

83.

"Python".swapcase() का output क्या होगा?

a)

pYTHON

b)

PYTHON

c)

python

d)

PytHON

84.

random.choice() function का उपयोग कब किया जाता है?

a)

To select a random element from a sequence

b)

To shuffle a sequence

c)

To generate a random number within a range

d)

To generate random floating-point numbers

85.

Python में random.shuffle() का उपयोग किसके लिए किया जाता है?

a)

To shuffle elements in a list randomly

b)

To create a sorted list

c)

To remove duplicates from a list

d)

To create a new random list

86.

math.ceil(9.1) का output क्या होगा?

a)

10

b)

9

c)

9.1

d)

Error

87.

Negative numbers पर math.sqrt() का उपयोग करने पर क्या होगा?

a)

ValueError

b)

Returns None

c)

Returns a negative square root

d)

Runs successfully

88.

math.sqrt(25) का सही output क्या है?

a)

5.0

b)

25.0

c)

125

d)

Error

89.

Math functions Python में किस module में उपलब्ध हैं?

a)

math

b)

random

c)

sys

d)

os

90.

Python का default recursion limit कितना होता है?

a)

1000

b)

500

c)

2000

d)

No limit

91.

Python में default recursion limit क्या है?

a)

1000

b)

500

c)

2000

d)

कोई सीमा नहीं

92.

len() का उपयोग किसके लिए किया जाता है?

a)

किसी वस्तु की लंबाई जानने के लिए

b)

सूची को क्रमबद्ध करने के लिए

c)

संख्याओं का योग निकालने के लिए

d)

सूची में सदस्यता की जांच करने के लिए

93.

def func(x, y=10): return x + y में y की value क्या है अगर इसे call किया जाए func(5)?

a)

10

b)

5

c)

0

d)

त्रुटि

94.

Docstring को runtime में कैसे access किया जाता है?

a)

__doc__ attribute का उपयोग करके

b)

print() function का उपयोग करके

c)

help() का उपयोग करके

d)

A और C दोनों

95.

Python में default arguments का उपयोग कब किया जाता है?

a)

जब function call के दौरान कोई value प्रदान नहीं की जाती

b)

अगर कोई value प्रदान नहीं की गई तो त्रुटि फेंकने के लिए

c)

जब सभी arguments अनिवार्य होते हैं

d)

हमेशा एक निश्चित value का उपयोग करने के लिए

96.

निम्नलिखित function call का output क्या होगा: def greet(name="Guest"): return f"Hello, {name}" print(greet())

a)

Hello, Guest

b)

Hello, name

c)

त्रुटि

d)

Hello

97.

Python में default arguments को कहाँ define किया जाता है?

a)

non-default arguments के बाद

b)

non-default arguments के पहले

c)

function definition की शुरुआत में

d)

function में कहीं भी

98.

"123abc".islower() का output क्या होगा?

a)

True

b)

False

c)

None

d)

त्रुटि

99.

"PYTHON".isupper() method का output क्या होगा?

a)

True

b)

False

c)

None

d)

त्रुटि

100.

random.random() function क्या return करता है?

a)

0 और 1 के बीच एक random float

b)

0 और 1 के बीच एक random integer

c)

0 और 10 के बीच एक random float

d)

त्रुटि

101.

निम्नलिखित code का output क्या हो सकता है: import random print(random.randint(1, 5))

a)

1 और 5 (inclusive) के बीच कोई भी integer

b)

1 और 5 (inclusive) के बीच कोई भी float

c)

त्रुटि

d)

हमेशा 5

102.

math.sqrt(49) का output क्या होगा?

a)

7.0

b)

7

c)

49

d)

त्रुटि

103.

Negative input के लिए math.ceil() का result क्या होता है?

a)

यह शून्य की ओर गोल करता है

b)

यह input के बराबर या उससे बड़ा सबसे छोटा integer में गोल करता है

c)

यह input के बराबर या उससे छोटा सबसे बड़ा integer में गोल करता है

d)

त्रुटि

104.

Function parameters को pass करने के लिए कौन सा argument type सबसे पहले use होता है?

a)

Positional arguments

b)

Default arguments

c)

Keyword arguments

d)

Variable-length arguments

105.

Python में help() function किसके लिए उपयोग किया जाता है?

a)

किसी object के docstring और module details को प्रदर्शित करने के लिए

b)

function में त्रुटियों को खोजने के लिए

c)

runtime output को प्रदर्शित करने के लिए

d)

program को debug करने के लिए

Similar Resources on Wayground