NSCT – Modules, Packages & Libraries MCQs 20 min Score: 0 Attempted: 0/20 Subscribe 1. What is a module in programming? (A) A type of loop (B) A file containing code that can be reused (C) A variable (D) A functionShow All Answers 2. What is the main purpose of using modules? (A) To store variables (B) To create loops (C) To organize code and promote reuse (D) To handle errorsShow All Answers 3. What is a package in programming? (A) A collection of modules organized in a directory (B) A single function (C) A loop structure (D) A variable typeShow All Answers 4. Which of the following is a benefit of using packages? (A) Memory allocation (B) Faster execution (C) Code organization and namespace management (D) Exception handlingShow All Answers 5. What is a library in programming? (A) A collection of pre-written modules or functions for reuse (B) A type of variable (C) A loop (D) A conditional statementShow All Answers 6. Which of the following allows importing code from other files? (A) Using loops (B) Importing a module (C) Declaring a variable (D) Creating a functionShow All Answers 7. How can a module be reused in another program? (A) By copying code manually (B) By importing it (C) By defining a loop (D) By creating a variableShow All Answers 8. Which of the following helps avoid name conflicts between modules? (A) Packages (B) Loops (C) Functions (D) VariablesShow All Answers 9. What is a standard library? (A) A variable type (B) A user-defined function (C) A loop structure (D) A collection of built-in modules provided by the programming languageShow All Answers 10. Which of the following is a third-party library? (A) A library created by external developers for reuse (B) A built-in module (C) A function in the main program (D) A loop structureShow All Answers 11. What is the main benefit of using libraries? (A) Allocates memory (B) Creates loops (C) Reduces coding effort and saves time (D) Stores variablesShow All Answers 12. Which keyword is commonly used to access a module in a program? (A) include (B) import (C) using (D) defineShow All Answers 13. What is the difference between a module and a package? (A) No difference (B) A module is a loop; a package is a function (C) A module stores variables; a package stores loops (D) A module is a single file; a package is a collection of modulesShow All Answers 14. Which of the following is true about libraries? (A) They provide pre-written code for common tasks (B) They store only variables (C) They are used only in loops (D) They cannot be reusedShow All Answers 15. What is the purpose of the __init__ file in a package? (A) To define loops (B) To store variables (C) To indicate that the directory is a package (D) To handle exceptionsShow All Answers 16. Can a module import another module? (A) Yes (B) No (C) Only in loops (D) Only in functionsShow All Answers 17. Which of the following is an example of a Python standard library? (A) Math (B) Custom module (C) Loop function (D) User-defined variableShow All Answers 18. What is the main advantage of using modules and packages? (A) Error handling (B) Faster compilation (C) Memory allocation (D) Code modularity, reuse, and organizationShow All Answers 19. Which of the following is used to install third-party libraries in Python? (A) import (B) pip (C) include (D) defineShow All Answers 20. What is a namespace in the context of modules and packages? (A) A loop structure (B) A container that holds identifiers like variable and function names to avoid conflicts (C) A type of library (D) A memory locationShow All Answers