wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

M3 R5 Chapter 8

Total questions: 100

Worksheet time: 50mins

Name
Class
Date
1.

Python में, किसी फ़ंक्शन के अंदर परिभाषित वेरिएबल का स्कोप क्या होता है?

a)

Global

b)

Local

c)

Non-local

d)

Universal

2.

Python में एक मॉड्यूल कैसे बनाया जा सकता है?

a)

By writing Python code in a .py file

b)

By creating a .module file

c)

By defining functions inside a Python script

d)

Both a and c

3.

LEGB नियम में "E" का क्या मतलब है?

a)

External

b)

Enclosing

c)

Environment

d)

Encapsulation

4.

Python मॉड्यूल के बारे में निम्न में से कौन सा सही है?

a)

A module is a file containing Python code.

b)

Modules help to organize code.

c)

Modules allow code reuse.

d)

All of the above

5.

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

a)

import module_name

b)

module_name import

c)

import_module module_name

d)

None of the above

6.

इंपोर्ट के समय आप किसी मॉड्यूल का नाम कैसे बदल सकते हैं?

a)

import module_name as new_name

b)

rename module_name as new_name

c)

import module_name -> new_name

d)

module_name.rename(new_name)

7.

मॉड्यूल फाइल्स के नेमस्पेस के रूप में कार्य करने के बारे में क्या सत्य है?

a)

Each module creates its own namespace.

b)

Variables in one module are isolated from other modules.

c)

Functions and variables in a module can be accessed using the dot operator.

d)

All of the above

8.

Python में किसी मॉड्यूल को रीलोड करने के लिए कौन सा फंक्शन उपयोग किया जाता है?

a)

reload()

b)

importlib.reload()

c)

reimport()

d)

module.reload()

9.

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

a)

math

b)

os

c)

sys

d)

All of the above

10.

Python में मॉड्यूल का उपयोग करने का क्या लाभ है?

a)

Code reusability

b)

Simplified debugging

c)

Better organization

d)

All of the above

11.

math मॉड्यूल से केवल sqrt फंक्शन को इंपोर्ट करने का सही सिंटैक्स क्या है?

a)

import sqrt from math

b)

from math import sqrt

c)

import math.sqrt

d)

from math import *

12.

कक्षा (class) के अंदर परिभाषित वेरिएबल किस स्कोप से संबंधित होते हैं?

a)

Local scope

b)

Global scope

c)

Class scope

d)

Function scope

13.

यदि एक वेरिएबल किसी फ़ंक्शन में और ग्लोबल स्कोप में परिभाषित है, तो फ़ंक्शन कौन सा मान उपयोग करेगा?

a)

Global variable

b)

Local variable

c)

Both values

d)

None of the above

14.

मॉड्यूल का उपयोग करते समय निम्न में से कौन कोड की पुनरावृत्ति को कम करता है?

a)

Writing code multiple times

b)

Using import statements

c)

Copy-pasting functions

d)

Redefining functions in every file

15.

Python में रैंडम नंबर जनरेशन के लिए कौन सा मॉड्यूल उपयोग किया जाता है?

a)

os

b)

random

c)

math

d)

sys

16.

LEGB नियम में enclosing scope क्या है?

a)

The global scope

b)

The scope of the outer function in a nested function

c)

The local scope of a function

d)

The built-in scope

17.

किसी मॉड्यूल से सभी नाम कैसे इंपोर्ट किए जा सकते हैं?

a)

import module_name.all

b)

from module_name import all

c)

from module_name import *

d)

import * from module_name

18.

मॉड्यूल एलियास का उपयोग क्यों किया जाता है?

a)

To create a copy of the module

b)

To simplify module names in the code

c)

To improve the performance of the module

d)

To protect the module from errors

19.

Python में किसी मॉड्यूल को रीलोड क्यों किया जाएगा?

a)

To apply changes made to the module without restarting the program

b)

To clear the cache of the module

c)

To delete the module's content

d)

To use a module with a new name

20.

Python में कमांड-लाइन तर्कों (arguments) तक पहुंच प्रदान करने वाला मॉड्यूल कौन सा है?

a)

os

b)

sys

c)

argparse

d)

input

21.

किसी वेरिएबल को लोकल स्कोप में घोषित करने के लिए कौन सा कीवर्ड उपयोग किया जाता है?

a)

local

b)

def

c)

No keyword is needed

d)

var

22.

Python में global कीवर्ड का उपयोग क्या है?

a)

To define a new global variable

b)

To access or modify a global variable inside a function

c)

To declare a local variable

d)

To remove a global variable

23.

निम्नलिखित कोड में, वेरिएबल x किस स्कोप से संबंधित है?

a)

Local

b)

Enclosing

c)

Global

d)

Built-in

24.

निम्नलिखित में से कौन सा फंक्शन Python के बिल्ट-इन स्कोप में आता है?

a)

print()

b)

len()

c)

max()

d)

All of the above

25.

Python मॉड्यूल के बारे में निम्नलिखित में से कौन सा कथन गलत है?

a)

Modules can be reused in other programs.

b)

Modules always run faster than plain scripts.

c)

Modules help in organizing the code better.

d)

Modules can contain functions, classes, and variables.

26.

यदि आप import module_name कथन का उपयोग करते हैं, तो क्या होता है?

a)

All functions and variables from the module are imported into the current namespace.

b)

The module is imported as an object, and its members must be accessed using the dot operator.

c)

Only the main function of the module is imported.

d)

None of the above.

27.

Python मॉड्यूल की फाइल एक्सटेंशन क्या है?

a)

.py

b)

.mod

c)

.module

d)

.pyc

28.

किसी मॉड्यूल को इंपोर्ट करते समय from कथन का उद्देश्य क्या है?

a)

To import the entire module.

b)

To import specific members of a module into the current namespace.

c)

To create a duplicate of the module.

d)

To rename the module at import.

29.

Python में जब आप किसी मॉड्यूल को इंपोर्ट करते हैं, तो क्या होता है?

a)

The code in the module gets executed

b)

The module's functions become available for use

c)

The entire module is copied into the program

d)

All of the above

30.

यदि एक वेरिएबल ग्लोबल स्कोप में परिभाषित है, तो उसे फ़ंक्शन के अंदर एक्सेस करते समय उसका डिफ़ॉल्ट स्कोप क्या होता है?

a)

Local scope

b)

Global scope

c)

Enclosing scope

d)

Built-in scope

31.

import math और from math import sqrt में क्या अंतर है?

a)

import math imports the entire module, while from math import sqrt imports only the sqrt function

b)

import math imports only the sqrt function

c)

There is no difference

d)

from math import sqrt imports the entire module

32.

LEGB नियम में "G" का क्या मतलब है?

a)

Global scope

b)

General scope

c)

Global function

d)

Group scope

33.

numpy मॉड्यूल को np के रूप में इंपोर्ट करने का सही तरीका क्या है?

a)

import numpy as np

b)

import numpy np

c)

import np from numpy

d)

import numpy = np

34.

ट करने का सही तरीका क्या है?

a)

import numpy as np

b)

import numpy np

c)

import np from numpy

d)

import numpy = np

35.

निम्नलिखित में से कौन Python के बिल्ट-इन स्कोप का हिस्सा है?

a)

print()

b)

math.sqrt()

c)

random.choice()

d)

sys.argv()

36.

Python में एक मॉड्यूल को परिभाषित करने के लिए इनमें से क्या आवश्यक है?

a)

A file with .py extension

b)

A class definition inside the file

c)

Functions inside the file

d)

All of the above

37.

math मॉड्यूल से sqrt फंक्शन को इंपोर्ट करने के बाद आप इसे कैसे एक्सेस करेंगे?

a)

sqrt(math)

b)

math.sqrt()

c)

math.sqroot()

d)

sqrt(math.sqrt)

38.

from ... import कथन आपको क्या करने की अनुमति देता है?

a)

Import specific functions or variables from a module

b)

Import all functions and variables from a module

c)

Import modules from a subdirectory

d)

Both a and b

39.

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

a)

os

b)

sys

c)

importlib

d)

math

40.

Python का कौन सा मॉड्यूल ऑपरेटिंग सिस्टम से इंटरैक्ट करने के लिए फंक्शन प्रदान करता है?

a)

os

b)

random

c)

time

d)

sys

41.

Python में, जब मॉड्यूल को सीधे निष्पादित किया जा रहा हो, तो __name__ एट्रिब्यूट का क्या मान होता है?

a)

'module'

b)

'__main__'

c)

'__file__'

d)

'__name__'

42.

जब आप एक Python मॉड्यूल को स्क्रिप्ट के रूप में चलाते हैं, तो क्या होता है?

a)

The module is imported and executed

b)

The module is executed, and its __name__ attribute is set to '__main__'

c)

The module is ignored by the interpreter

d)

Only the functions of the module are executed

43.

यदि एक मॉड्यूल को एक ही प्रोग्राम में दो बार इंपोर्ट किया जाए तो क्या होता है?

a)

It raises an error

b)

It is imported only once, and subsequent imports are ignored

c)

It overwrites the previous import

d)

It wi

44.

्यूल को एक ही प्रोग्राम में दो बार इंपोर्ट किया जाए तो क्या होता है?

a)

It raises an error

b)

It is imported only once, and subsequent imports are ignored

c)

It overwrites the previous import

d)

It will result in slower execution

45.

Python में, नेमस्पेस क्या है?

a)

A place where all variables are stored

b)

A space that defines the scope of a variable

c)

A special module to store functions

d)

A space to execute code

46.

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

a)

length()

b)

size()

c)

str_length()

d)

len()

47.

Python में मॉड्यूल नेमस्पेस क्या है?

a)

A namespace that refers to a specific module's name

b)

A namespace where all global variables are stored

c)

A special namespace where only functions are available

d)

A unique namespace assigned to the Python interpreter

48.

Python में reload() फंक्शन किसी मॉड्यूल पर क्या प्रभाव डालता है?

a)

It resets the module to its original state

b)

It clears the module's cache and reimports the module

c)

It makes the module permanent in memory

d)

It does nothing to the module

49.

Python में from ... import * का उपयोग करने का नुकसान क्या है?

a)

It imports everything, which could lead to namespace conflicts

b)

It imports only specific functions

c)

It does not work with built-in modules

d)

It increases memory usage

50.

Python में फ़ंक्शन के अंदर ग्लोबल वेरिएबल को कैसे एक्सेस करेंगे?

a)

By directly using the variable

b)

By using the global keyword

c)

By defining it again inside the function

d)

By using the enclosing keyword

51.

जब एक मॉड्यूल Python में इंपोर्ट किया जाता है, तो इसे कहां स्टोर किया जाता है?

a)

In the global namespace

b)

In the interpreter's memory

c)

In a cache file

d)

In the module's own namespace

52.

इंपोर्ट किया जाता है, तो इसे कहां स्टोर किया जाता है?

a)

In the global namespace

b)

In the interpreter's memory

c)

In a cache file

d)

In the module's own namespace

53.

आप इंपोर्ट प्रक्रिया के दौरान एक इंपोर्ट किए गए मॉड्यूल का नाम कैसे बदल सकते हैं?

a)

import module as alias_name

b)

import alias_name from module

c)

from module import alias_name

d)

rename module as alias_name

54.

आप इंपोर्ट किए गए मॉड्यूल bar से फंक्शन foo को कैसे कॉल करेंगे?

a)

bar.foo()

b)

foo.bar()

c)

import bar.foo()

d)

import foo.bar()

55.

Python में निम्नलिखित में से कौन सा बिल्ट-इन मॉड्यूल है?

a)

random

b)

math

c)

sys

d)

All of the above

56.

Python में sys मॉड्यूल का उद्देश्य क्या है?

a)

Provides functions for interacting with the system

b)

Allows access to system-specific parameters

c)

Handles command-line arguments

d)

All of the above

57.

आप किसी मॉड्यूल mymodule से वेरिएबल x को कैसे एक्सेस करेंगे?

a)

mymodule.x

b)

import mymodule.x

c)

mymodule(x)

d)

from mymodule import x

58.

Python मॉड्यूल को परिभाषित करने के लिए क्या आवश्यक है?

a)

A file with .py extension

b)

A Python class inside the file

c)

Functions in the module

d)

All of the above

59.

कौन सा कथन math मॉड्यूल से कई फंक्शन्स को इंपोर्ट करता है?

a)

import math.function1, function2

b)

from math import function1, function2

c)

import function1, function2 from math

d)

from math import *

60.

Python इंपोर्ट कथन का उपयोग करते समय मॉड्यूल के लिए कहां खोज करता है?

a)

In the current directory

b)

In the directories listed in sys.path

c)

In the Python standard library

d)

All of the above

61.

Python पैकेज में __init__.py का उद्देश्य क्या है?

a)

It marks a directory as a package

b)

It initializes the package

c)

It executes the code when the package is imported

d)

All of the above

62.

क्या है?

a)

It marks a directory as a package

b)

It initializes the package

c)

It executes the code when the package is imported

d)

All of the above

63.

मॉड्यूल में बदलाव करने के बाद आप उसे रीलोड करने के लिए कौन सा फंक्शन उपयोग करेंगे?

a)

reload()

b)

importlib.reload()

c)

reload(module_name)

d)

Both b and c

64.

जब एक मॉड्यूल सीधे निष्पादित किया जाता है, तो __name__ का मान क्या होता है?

a)

'module'

b)

'__main__'

c)

'__init__'

d)

'__file__'

65.

जब आप import math का उपयोग करते हैं तो क्या होता है?

a)

Only the math function is imported

b)

All functions and variables in the math module are available

c)

math module is renamed to math_function

d)

Only sqrt function is imported

66.

Python में कौन सा मॉड्यूल तिथियों और समय के साथ काम करने में मदद करता है?

a)

datetime

b)

time

c)

calendar

d)

All of the above

67.

यदि इंपोर्ट कथन के दौरान कोई मॉड्यूल नहीं मिलता है तो क्या होता है?

a)

Python raises a ModuleNotFoundError

b)

Python ignores the error and continues

c)

Python raises an ImportError

d)

Both a and c

68.

Python किसी मॉड्यूल को डिपेंडेंसी के साथ इंपोर्ट करने को कैसे संभालता है?

a)

It imports the module and all its dependencies

b)

It imports only the module, not the dependencies

c)

It raises an error

d)

It ignores dependencies

69.

क्या आप Python में एक मॉड्यूल के अंदर दूसरे मॉड्यूल को इंपोर्ट कर सकते हैं?

a)

Yes, using the import statement

b)

No, Python doesn't allow it

c)

Yes, but only if both modules are in the same directory

d)

No, you need to use external libraries for it

70.

फ़ंक्शन के अंदर परिभाषित वेरिएबल का स्कोप क्या होता है?

a)

Local scope

b)

Global scope

c)

Enclosing scope

d)

Built-in scope

71.

Python में फ़ंक्शन के अंदर ग्लोबल वेरिएबल को कैसे एक्सेस करेंगे?

a)

By directly using the variable

b)

By using the global keyword

c)

By defining it again inside the function

d)

By using the enclosing keyword

72.

जब एक मॉड्यूल Python में इंपोर्ट किया जाता है, तो इसे कहां स्टोर किया जाता है?

a)

In the global namespace

b)

In the interpreter's memory

c)

In a cache file

d)

In the module's own namespace

73.

आप इंपोर्ट प्रक्रिया के दौरान एक इंपोर्ट किए गए मॉड्यूल का नाम कैसे बदल सकते हैं?

a)

import module as alias_name

b)

import alias_name from module

c)

from module import alias_name

d)

rename module as alias_name

74.

आप इंपोर्ट किए गए मॉड्यूल bar से फंक्शन foo को कैसे कॉल करेंगे?

a)

bar.foo()

b)

foo.bar()

c)

import bar.foo()

d)

import foo.bar()

75.

Python में निम्नलिखित में से कौन सा बिल्ट-इन मॉड्यूल है?

a)

random

b)

math

c)

sys

d)

All of the above

76.

Python में sys मॉड्यूल का उद्देश्य क्या है?

a)

Provides functions for interacting with the system

b)

Allows access to system-specific parameters

c)

Handles command-line arguments

d)

All of the above

77.

आप किसी मॉड्यूल mymodule से वेरिएबल x को कैसे एक्सेस करेंगे?

a)

mymodule.x

b)

import mymodule.x

c)

mymodule(x)

d)

from mymodule import x

78.

Python मॉड्यूल को परिभाषित करने के लिए क्या आवश्यक है?

a)

A file with .py extension

b)

A Python class inside the file

c)

Functions in the module

d)

All of the above

79.

कौन सा कथन math मॉड्यूल से कई फंक्शन्स को इंपोर्ट करता है?

a)

import math.function1, function2

b)

from math import function1, function2

c)

import function1, function2 from math

d)

from math import *

80.

Python इंपोर्ट कथन का उपयोग करते समय मॉड्यूल के लिए कहां खोज करता है?

a)

In the current directory

b)

In the directories listed in sys.path

c)

In the Python standard library

d)

All of the above

81.

Python पैकेज में __init__.py का उद्देश्य क्या है?

a)

It marks a directory as a package

b)

It initializes the package

c)

It executes the code when the package is imported

d)

All of the above

82.

मॉड्यूल में बदलाव करने के बाद आप उसे रीलोड करने के लिए कौन सा फंक्शन उपयोग करेंगे?

a)

reload()

b)

importlib.reload()

c)

reload(module_name)

d)

Both b and c

83.

जब एक मॉड्यूल सीधे निष्पादित किया जाता है, तो __name__ का मान क्या होता है?

a)

'module'

b)

'__main__'

c)

'__init__'

d)

'__file__'

84.

जब आप import math का उपयोग करते हैं तो क्या होता है?

a)

Only the math function is imported

b)

All functions and variables in the math module are available

c)

math module is renamed to math_function

d)

Only sqrt function is imported

85.

Python में कौन सा मॉड्यूल तिथियों और समय के साथ काम करने में मदद करता है?

a)

datetime

b)

time

c)

calendar

d)

All of the above

86.

यदि इंपोर्ट कथन के दौरान कोई मॉड्यूल नहीं मिलता है तो क्या होता है?

a)

Python raises a ModuleNotFoundError

b)

Python ignores the error and continues

c)

Python raises an ImportError

d)

Both a and c

87.

Python किसी मॉड्यूल को डिपेंडेंसी के साथ इंपोर्ट करने को कैसे संभालता है?

a)

It imports the module and all its dependencies

b)

It imports only the module, not the dependencies

c)

It raises an error

d)

It ignores dependencies

88.

को कैसे संभालता है?

a)

It imports the module and all its dependencies

b)

It imports only the module, not the dependencies

c)

It raises an error

d)

It ignores dependencies

89.

क्या आप Python में एक मॉड्यूल के अंदर दूसरे मॉड्यूल को इंपोर्ट कर सकते हैं?

a)

Yes, using the import statement

b)

No, Python doesn't allow it

c)

Yes, but only if both modules are in the same directory

d)

No, you need to use external libraries for it

90.

फ़ंक्शन के अंदर परिभाषित वेरिएबल का स्कोप क्या होता है?

a)

Local scope

b)

Global scope

c)

Enclosing scope

d)

Built-in scope

91.

import math as m का उपयोग करने का क्या लाभ है, बजाय इसके कि import math का उपयोग किया जाए?

a)

It makes the code more concise

b)

It avoids naming conflicts

c)

It speeds up execution

d)

Both a and b

92.

आप math मॉड्यूल से sqrt फंक्शन को बिना पूरा मॉड्यूल नाम इस्तेमाल किए कैसे एक्सेस करेंगे?

a)

sqrt()

b)

math.sqrt()

c)

from math import sqrt

d)

import sqrt from math

93.

Python में sys.argv क्या स्टोर करता है?

a)

The name of the current module

b)

The command-line arguments passed to the Python script

c)

The Python interpreter version

d)

The list of imported modules

94.

Python मॉड्यूल के लिए अनुशंसित नामकरण सम्मेलन क्या है?

a)

All lowercase letters, with words separated by underscores

b)

Uppercase letters with no spaces

c)

CamelCase with the first letter capitalized

d)

Any naming format is allowed

95.

Python में मॉड्यूल को रीलोड करने के लिए कौन सी लाइब्रेरी का उपयोग किया जा सकता है?

a)

importlib

b)

sys

c)

os

d)

reload

96.

import math as m का उपयोग करने का क्या लाभ है, बजाय इसके कि import math?

a)

It makes the

code more concise

b)

It avoids naming conflicts

c)

It speeds up execution

d)

Both a and b

97.

Python पैकेज में रिलेटिव इंपोर्ट क्या होता है?

a)

Importing modules from the current directory

b)

Importing from a sibling module

c)

Importing from the parent module

d)

All of the above

98.

Python में एक मॉड्यूल को कैसे इंपोर्ट किया जाता है?

a)

include module_name

b)

load module_name

c)

require module_name

d)

import module_name

99.

Python में एक मॉड्यूल के अंदर फ़ंक्शन को कैसे परिभाषित किया जाता है?

a)

Using the define keyword

b)

Using the create keyword

c)

Using the function keyword

d)

Using the def keyword

100.

Python में एक मॉड्यूल को रीलोड करने के लिए कौन सा फंक्शन उपयोग किया जाता है?

a)

reload()

b)

import()

c)

refresh()

d)

update()