Python modules interview questions
1. What is a Python module? Answer: A Python module is a file containing Python code, which can define functions, classes, and variables. It allows you to organize code into separate files for better code organization and reusability. 2. How can you import a module in Python? Answer: You can import a module in Python using the `import` statement. For example: python import mymodule 3. What is the difference between `import module` and `from module import something`? Answer: - `import module` imports the entire module, and you must use the module's name to access its contents (e.g., `module.function()`). - `from module import something` imports a specific item (function, class, variable) from the module, and you can use it directly without the module prefix (e.g., `function()`). 4. What is the purpose of the `if __name__ == "__main__":` statement in P...