Python Modules MCQs | JoinMyTutor

MCQs on using Python modules and imports.

Modules MCQs cover Python modules, packages, import mechanisms, and creating reusable code components. Learners practice organizing code efficiently, understanding standard libraries, and applying modular design principles. These MCQs strengthen Python programming fundamentals, enabling students to build scalable and maintainable applications.}

Modules MCQs

  1. What is a module in Python?
    • A. A loop
    • B. A class
    • C. A file containing Python definitions and statements
    • D. A function

    Answer: C — A module is simply a Python file with functions, classes, and variables.

  2. Which keyword is used to include a module?
    • A. include
    • B. require
    • C. import
    • D. use

    Answer: C — The import keyword is used to include modules.

  3. Which function returns a list of all attributes of a module?
    • A. list()
    • B. dir()
    • C. globals()
    • D. locals()

    Answer: B — The dir() function lists all attributes of a module.

  4. Which module in Python supports random number generation?
    • A. math
    • B. random
    • C. statistics
    • D. sys

    Answer: B — The random module generates random numbers.

  5. What is the file extension of a Python module?
    • A. .mod
    • B. .py
    • C. .pym
    • D. .pyc

    Answer: B — Modules are Python files with a .py extension.

💡 Tips & Common Mistakes

Remember to review concepts carefully. Fill in custom tips for modules here.

📅 Last Updated: November 20, 2026

Vinod Kumar avatar

Vinod Kumar

Senior Full-Stack Instructor

Python & JavaScript Tutor at JoinMyTutor

Vinod teaches practical Python and JavaScript—ranging from basics to advanced web apps—with a focus on clear mental models, code readability, and interview preparation. He authors both the Python and JavaScript tracks on JoinMyTutor.

#Python #Flask #Pandas #JavaScript #Node.js #React #ES6+ #Async/Await #DOM Manipulation
banner