What is a Python module?
What is a Python module?
a. A module is a file containing Python code (classes, functions variables, etc.). In the module, the name of the module (as a string) is available as the global variable name
.
b. A module is a file containing Python code (classes, functions variables, etc.). The module name is the name of the file without the .py
extension. In the module, the module name (as a string) is available as the global variable __name__
c. A module is another name for a function.
d. A module is a directory that contains Python scripts.
b. A module is a file containing Python code (classes, functions variables, etc.). The module name is the name of the file without the .py
extension. In the module, the module name (as a string) is available as the global variable __name__
Explanation
A module is a file containing Python definitions and statements. The file name is the module name with the suffix .py
appended. Within a module, the module’s name (as a string) is available as the value of the global variable __name__
.