Font size
WorksheetsM3 R5 Chapter 8
Total questions: 100
Worksheet time: 50mins
Python में, किसी फ़ंक्शन के अंदर परिभाषित वेरिएबल का स्कोप क्या होता है?
Global
Local
Non-local
Universal
Python में एक मॉड्यूल कैसे बनाया जा सकता है?
By writing Python code in a .py file
By creating a .module file
By defining functions inside a Python script
Both a and c
LEGB नियम में "E" का क्या मतलब है?
External
Enclosing
Environment
Encapsulation
Python मॉड्यूल के बारे में निम्न में से कौन सा सही है?
A module is a file containing Python code.
Modules help to organize code.
Modules allow code reuse.
All of the above
Python में किसी मॉड्यूल को इंपोर्ट करने का सही तरीका क्या है?
import module_name
module_name import
import_module module_name
None of the above
इंपोर्ट के समय आप किसी मॉड्यूल का नाम कैसे बदल सकते हैं?
import module_name as new_name
rename module_name as new_name
import module_name -> new_name
module_name.rename(new_name)
मॉड्यूल फाइल्स के नेमस्पेस के रूप में कार्य करने के बारे में क्या सत्य है?
Each module creates its own namespace.
Variables in one module are isolated from other modules.
Functions and variables in a module can be accessed using the dot operator.
All of the above
Python में किसी मॉड्यूल को रीलोड करने के लिए कौन सा फंक्शन उपयोग किया जाता है?
reload()
importlib.reload()
reimport()
module.reload()
निम्नलिखित में से कौन सा Python का स्टैंडर्ड मॉड्यूल है?
math
os
sys
All of the above
Python में मॉड्यूल का उपयोग करने का क्या लाभ है?
Code reusability
Simplified debugging
Better organization
All of the above
math मॉड्यूल से केवल sqrt फंक्शन को इंपोर्ट करने का सही सिंटैक्स क्या है?
import sqrt from math
from math import sqrt
import math.sqrt
from math import *
कक्षा (class) के अंदर परिभाषित वेरिएबल किस स्कोप से संबंधित होते हैं?
Local scope
Global scope
Class scope
Function scope
यदि एक वेरिएबल किसी फ़ंक्शन में और ग्लोबल स्कोप में परिभाषित है, तो फ़ंक्शन कौन सा मान उपयोग करेगा?
Global variable
Local variable
Both values
None of the above
मॉड्यूल का उपयोग करते समय निम्न में से कौन कोड की पुनरावृत्ति को कम करता है?
Writing code multiple times
Using import statements
Copy-pasting functions
Redefining functions in every file
Python में रैंडम नंबर जनरेशन के लिए कौन सा मॉड्यूल उपयोग किया जाता है?
os
random
math
sys
LEGB नियम में enclosing scope क्या है?
The global scope
The scope of the outer function in a nested function
The local scope of a function
The built-in scope
किसी मॉड्यूल से सभी नाम कैसे इंपोर्ट किए जा सकते हैं?
import module_name.all
from module_name import all
from module_name import *
import * from module_name
मॉड्यूल एलियास का उपयोग क्यों किया जाता है?
To create a copy of the module
To simplify module names in the code
To improve the performance of the module
To protect the module from errors
Python में किसी मॉड्यूल को रीलोड क्यों किया जाएगा?
To apply changes made to the module without restarting the program
To clear the cache of the module
To delete the module's content
To use a module with a new name
Python में कमांड-लाइन तर्कों (arguments) तक पहुंच प्रदान करने वाला मॉड्यूल कौन सा है?
os
sys
argparse
input
किसी वेरिएबल को लोकल स्कोप में घोषित करने के लिए कौन सा कीवर्ड उपयोग किया जाता है?
local
def
No keyword is needed
var
Python में global कीवर्ड का उपयोग क्या है?
To define a new global variable
To access or modify a global variable inside a function
To declare a local variable
To remove a global variable
निम्नलिखित कोड में, वेरिएबल x किस स्कोप से संबंधित है?
Local
Enclosing
Global
Built-in
निम्नलिखित में से कौन सा फंक्शन Python के बिल्ट-इन स्कोप में आता है?
print()
len()
max()
All of the above
Python मॉड्यूल के बारे में निम्नलिखित में से कौन सा कथन गलत है?
Modules can be reused in other programs.
Modules always run faster than plain scripts.
Modules help in organizing the code better.
Modules can contain functions, classes, and variables.
यदि आप import module_name कथन का उपयोग करते हैं, तो क्या होता है?
All functions and variables from the module are imported into the current namespace.
The module is imported as an object, and its members must be accessed using the dot operator.
Only the main function of the module is imported.
None of the above.
Python मॉड्यूल की फाइल एक्सटेंशन क्या है?
.py
.mod
.module
.pyc
किसी मॉड्यूल को इंपोर्ट करते समय from कथन का उद्देश्य क्या है?
To import the entire module.
To import specific members of a module into the current namespace.
To create a duplicate of the module.
To rename the module at import.
Python में जब आप किसी मॉड्यूल को इंपोर्ट करते हैं, तो क्या होता है?
The code in the module gets executed
The module's functions become available for use
The entire module is copied into the program
All of the above
यदि एक वेरिएबल ग्लोबल स्कोप में परिभाषित है, तो उसे फ़ंक्शन के अंदर एक्सेस करते समय उसका डिफ़ॉल्ट स्कोप क्या होता है?
Local scope
Global scope
Enclosing scope
Built-in scope
import math और from math import sqrt में क्या अंतर है?
import math imports the entire module, while from math import sqrt imports only the sqrt function
import math imports only the sqrt function
There is no difference
from math import sqrt imports the entire module
LEGB नियम में "G" का क्या मतलब है?
Global scope
General scope
Global function
Group scope
numpy मॉड्यूल को np के रूप में इंपोर्ट करने का सही तरीका क्या है?
import numpy as np
import numpy np
import np from numpy
import numpy = np
ट करने का सही तरीका क्या है?
import numpy as np
import numpy np
import np from numpy
import numpy = np
निम्नलिखित में से कौन Python के बिल्ट-इन स्कोप का हिस्सा है?
print()
math.sqrt()
random.choice()
sys.argv()
Python में एक मॉड्यूल को परिभाषित करने के लिए इनमें से क्या आवश्यक है?
A file with .py extension
A class definition inside the file
Functions inside the file
All of the above
math मॉड्यूल से sqrt फंक्शन को इंपोर्ट करने के बाद आप इसे कैसे एक्सेस करेंगे?
sqrt(math)
math.sqrt()
math.sqroot()
sqrt(math.sqrt)
from ... import कथन आपको क्या करने की अनुमति देता है?
Import specific functions or variables from a module
Import all functions and variables from a module
Import modules from a subdirectory
Both a and b
Python में किसी मॉड्यूल को रीलोड करने के लिए कौन सा मॉड्यूल उपयोग किया जाता है?
os
sys
importlib
math
Python का कौन सा मॉड्यूल ऑपरेटिंग सिस्टम से इंटरैक्ट करने के लिए फंक्शन प्रदान करता है?
os
random
time
sys
Python में, जब मॉड्यूल को सीधे निष्पादित किया जा रहा हो, तो __name__ एट्रिब्यूट का क्या मान होता है?
'module'
'__main__'
'__file__'
'__name__'
जब आप एक Python मॉड्यूल को स्क्रिप्ट के रूप में चलाते हैं, तो क्या होता है?
The module is imported and executed
The module is executed, and its __name__ attribute is set to '__main__'
The module is ignored by the interpreter
Only the functions of the module are executed
यदि एक मॉड्यूल को एक ही प्रोग्राम में दो बार इंपोर्ट किया जाए तो क्या होता है?
It raises an error
It is imported only once, and subsequent imports are ignored
It overwrites the previous import
It wi
्यूल को एक ही प्रोग्राम में दो बार इंपोर्ट किया जाए तो क्या होता है?
It raises an error
It is imported only once, and subsequent imports are ignored
It overwrites the previous import
It will result in slower execution
Python में, नेमस्पेस क्या है?
A place where all variables are stored
A space that defines the scope of a variable
A special module to store functions
A space to execute code
Python में किसी स्ट्रिंग की लंबाई प्राप्त करने के लिए निम्नलिखित में से कौन सा बिल्ट-इन फंक्शन उपयोग किया जाता है?
length()
size()
str_length()
len()
Python में मॉड्यूल नेमस्पेस क्या है?
A namespace that refers to a specific module's name
A namespace where all global variables are stored
A special namespace where only functions are available
A unique namespace assigned to the Python interpreter
Python में reload() फंक्शन किसी मॉड्यूल पर क्या प्रभाव डालता है?
It resets the module to its original state
It clears the module's cache and reimports the module
It makes the module permanent in memory
It does nothing to the module
Python में from ... import * का उपयोग करने का नुकसान क्या है?
It imports everything, which could lead to namespace conflicts
It imports only specific functions
It does not work with built-in modules
It increases memory usage
Python में फ़ंक्शन के अंदर ग्लोबल वेरिएबल को कैसे एक्सेस करेंगे?
By directly using the variable
By using the global keyword
By defining it again inside the function
By using the enclosing keyword
जब एक मॉड्यूल Python में इंपोर्ट किया जाता है, तो इसे कहां स्टोर किया जाता है?
In the global namespace
In the interpreter's memory
In a cache file
In the module's own namespace
इंपोर्ट किया जाता है, तो इसे कहां स्टोर किया जाता है?
In the global namespace
In the interpreter's memory
In a cache file
In the module's own namespace
आप इंपोर्ट प्रक्रिया के दौरान एक इंपोर्ट किए गए मॉड्यूल का नाम कैसे बदल सकते हैं?
import module as alias_name
import alias_name from module
from module import alias_name
rename module as alias_name
आप इंपोर्ट किए गए मॉड्यूल bar से फंक्शन foo को कैसे कॉल करेंगे?
bar.foo()
foo.bar()
import bar.foo()
import foo.bar()
Python में निम्नलिखित में से कौन सा बिल्ट-इन मॉड्यूल है?
random
math
sys
All of the above
Python में sys मॉड्यूल का उद्देश्य क्या है?
Provides functions for interacting with the system
Allows access to system-specific parameters
Handles command-line arguments
All of the above
आप किसी मॉड्यूल mymodule से वेरिएबल x को कैसे एक्सेस करेंगे?
mymodule.x
import mymodule.x
mymodule(x)
from mymodule import x
Python मॉड्यूल को परिभाषित करने के लिए क्या आवश्यक है?
A file with .py extension
A Python class inside the file
Functions in the module
All of the above
कौन सा कथन math मॉड्यूल से कई फंक्शन्स को इंपोर्ट करता है?
import math.function1, function2
from math import function1, function2
import function1, function2 from math
from math import *
Python इंपोर्ट कथन का उपयोग करते समय मॉड्यूल के लिए कहां खोज करता है?
In the current directory
In the directories listed in sys.path
In the Python standard library
All of the above
Python पैकेज में __init__.py का उद्देश्य क्या है?
It marks a directory as a package
It initializes the package
It executes the code when the package is imported
All of the above
क्या है?
It marks a directory as a package
It initializes the package
It executes the code when the package is imported
All of the above
मॉड्यूल में बदलाव करने के बाद आप उसे रीलोड करने के लिए कौन सा फंक्शन उपयोग करेंगे?
reload()
importlib.reload()
reload(module_name)
Both b and c
जब एक मॉड्यूल सीधे निष्पादित किया जाता है, तो __name__ का मान क्या होता है?
'module'
'__main__'
'__init__'
'__file__'
जब आप import math का उपयोग करते हैं तो क्या होता है?
Only the math function is imported
All functions and variables in the math module are available
math module is renamed to math_function
Only sqrt function is imported
Python में कौन सा मॉड्यूल तिथियों और समय के साथ काम करने में मदद करता है?
datetime
time
calendar
All of the above
यदि इंपोर्ट कथन के दौरान कोई मॉड्यूल नहीं मिलता है तो क्या होता है?
Python raises a ModuleNotFoundError
Python ignores the error and continues
Python raises an ImportError
Both a and c
Python किसी मॉड्यूल को डिपेंडेंसी के साथ इंपोर्ट करने को कैसे संभालता है?
It imports the module and all its dependencies
It imports only the module, not the dependencies
It raises an error
It ignores dependencies
क्या आप Python में एक मॉड्यूल के अंदर दूसरे मॉड्यूल को इंपोर्ट कर सकते हैं?
Yes, using the import statement
No, Python doesn't allow it
Yes, but only if both modules are in the same directory
No, you need to use external libraries for it
फ़ंक्शन के अंदर परिभाषित वेरिएबल का स्कोप क्या होता है?
Local scope
Global scope
Enclosing scope
Built-in scope
Python में फ़ंक्शन के अंदर ग्लोबल वेरिएबल को कैसे एक्सेस करेंगे?
By directly using the variable
By using the global keyword
By defining it again inside the function
By using the enclosing keyword
जब एक मॉड्यूल Python में इंपोर्ट किया जाता है, तो इसे कहां स्टोर किया जाता है?
In the global namespace
In the interpreter's memory
In a cache file
In the module's own namespace
आप इंपोर्ट प्रक्रिया के दौरान एक इंपोर्ट किए गए मॉड्यूल का नाम कैसे बदल सकते हैं?
import module as alias_name
import alias_name from module
from module import alias_name
rename module as alias_name
आप इंपोर्ट किए गए मॉड्यूल bar से फंक्शन foo को कैसे कॉल करेंगे?
bar.foo()
foo.bar()
import bar.foo()
import foo.bar()
Python में निम्नलिखित में से कौन सा बिल्ट-इन मॉड्यूल है?
random
math
sys
All of the above
Python में sys मॉड्यूल का उद्देश्य क्या है?
Provides functions for interacting with the system
Allows access to system-specific parameters
Handles command-line arguments
All of the above
आप किसी मॉड्यूल mymodule से वेरिएबल x को कैसे एक्सेस करेंगे?
mymodule.x
import mymodule.x
mymodule(x)
from mymodule import x
Python मॉड्यूल को परिभाषित करने के लिए क्या आवश्यक है?
A file with .py extension
A Python class inside the file
Functions in the module
All of the above
कौन सा कथन math मॉड्यूल से कई फंक्शन्स को इंपोर्ट करता है?
import math.function1, function2
from math import function1, function2
import function1, function2 from math
from math import *
Python इंपोर्ट कथन का उपयोग करते समय मॉड्यूल के लिए कहां खोज करता है?
In the current directory
In the directories listed in sys.path
In the Python standard library
All of the above
Python पैकेज में __init__.py का उद्देश्य क्या है?
It marks a directory as a package
It initializes the package
It executes the code when the package is imported
All of the above
मॉड्यूल में बदलाव करने के बाद आप उसे रीलोड करने के लिए कौन सा फंक्शन उपयोग करेंगे?
reload()
importlib.reload()
reload(module_name)
Both b and c
जब एक मॉड्यूल सीधे निष्पादित किया जाता है, तो __name__ का मान क्या होता है?
'module'
'__main__'
'__init__'
'__file__'
जब आप import math का उपयोग करते हैं तो क्या होता है?
Only the math function is imported
All functions and variables in the math module are available
math module is renamed to math_function
Only sqrt function is imported
Python में कौन सा मॉड्यूल तिथियों और समय के साथ काम करने में मदद करता है?
datetime
time
calendar
All of the above
यदि इंपोर्ट कथन के दौरान कोई मॉड्यूल नहीं मिलता है तो क्या होता है?
Python raises a ModuleNotFoundError
Python ignores the error and continues
Python raises an ImportError
Both a and c
Python किसी मॉड्यूल को डिपेंडेंसी के साथ इंपोर्ट करने को कैसे संभालता है?
It imports the module and all its dependencies
It imports only the module, not the dependencies
It raises an error
It ignores dependencies
को कैसे संभालता है?
It imports the module and all its dependencies
It imports only the module, not the dependencies
It raises an error
It ignores dependencies
क्या आप Python में एक मॉड्यूल के अंदर दूसरे मॉड्यूल को इंपोर्ट कर सकते हैं?
Yes, using the import statement
No, Python doesn't allow it
Yes, but only if both modules are in the same directory
No, you need to use external libraries for it
फ़ंक्शन के अंदर परिभाषित वेरिएबल का स्कोप क्या होता है?
Local scope
Global scope
Enclosing scope
Built-in scope
import math as m का उपयोग करने का क्या लाभ है, बजाय इसके कि import math का उपयोग किया जाए?
It makes the code more concise
It avoids naming conflicts
It speeds up execution
Both a and b
आप math मॉड्यूल से sqrt फंक्शन को बिना पूरा मॉड्यूल नाम इस्तेमाल किए कैसे एक्सेस करेंगे?
sqrt()
math.sqrt()
from math import sqrt
import sqrt from math
Python में sys.argv क्या स्टोर करता है?
The name of the current module
The command-line arguments passed to the Python script
The Python interpreter version
The list of imported modules
Python मॉड्यूल के लिए अनुशंसित नामकरण सम्मेलन क्या है?
All lowercase letters, with words separated by underscores
Uppercase letters with no spaces
CamelCase with the first letter capitalized
Any naming format is allowed
Python में मॉड्यूल को रीलोड करने के लिए कौन सी लाइब्रेरी का उपयोग किया जा सकता है?
importlib
sys
os
reload
import math as m का उपयोग करने का क्या लाभ है, बजाय इसके कि import math?
It makes the
code more concise
It avoids naming conflicts
It speeds up execution
Both a and b
Python पैकेज में रिलेटिव इंपोर्ट क्या होता है?
Importing modules from the current directory
Importing from a sibling module
Importing from the parent module
All of the above
Python में एक मॉड्यूल को कैसे इंपोर्ट किया जाता है?
include module_name
load module_name
require module_name
import module_name
Python में एक मॉड्यूल के अंदर फ़ंक्शन को कैसे परिभाषित किया जाता है?
Using the define keyword
Using the create keyword
Using the function keyword
Using the def keyword
Python में एक मॉड्यूल को रीलोड करने के लिए कौन सा फंक्शन उपयोग किया जाता है?
reload()
import()
refresh()
update()
