W3
Teacher
Explore
Browse by field
Artificial Intelligence
Accounting & Finance
Information Technology
Show all fields
Interview Q&A
All Interview Questions
Beginner
Intermediate
Advanced
Practice
MCQs
Quizzes
Mock Interviews
About
Light
Dark
Auto
Sign in
Get Started
Search interview questions
Search
26 questions for “Modules & Packaging”
Found in 1 field. Select a question to see its full answer.
Matching topics
Python
Modules
&
Packaging
15
Information Technology
26 questions in 1 technology
#
Question
Technology
Topic
Level
1
What does the `if __name__ == '__main__':` idiom accomplish, and why is it important for
modules
?
Python › Modules & Packaging
Python
Modules
&
Packaging
Intermediate
2
How does Python locate
modules
during import, and what is sys.path's role?
Python › Modules & Packaging
Python
Modules
&
Packaging
Advanced
3
How do entry points in
packaging
metadata enable a package to register CLI commands or plugins?
Python › Modules & Packaging
Python
Modules
&
Packaging
Advanced
4
What is the difference between a module and a package in Python?
Python › Modules & Packaging
Python
Modules
&
Packaging
Beginner
5
What does the __init__.py file do inside a package directory?
Python › Modules & Packaging
Python
Modules
&
Packaging
Beginner
6
How does Python's module import system avoid re-executing a module multiple times when imported from different places?
Python › Modules & Packaging
Python
Modules
&
Packaging
Intermediate
7
What is the difference between an absolute import and a relative import within a package?
Python › Modules & Packaging
Python
Modules
&
Packaging
Intermediate
8
How does pyproject.toml serve as the modern standard for defining a Python package's build configuration and dependencies?
Python › Modules & Packaging
Python
Modules
&
Packaging
Intermediate
9
What is __all__ and how does it control `from module import *` behavior?
Python › Modules & Packaging
Python
Modules
&
Packaging
Intermediate
10
What is the purpose of a `requirements.txt` file, and how does it differ from dependency declarations in pyproject.toml?
Python › Modules & Packaging
Python
Modules
&
Packaging
Intermediate
Show all 26 questions in Information Technology