← Back to Python

Python Modules, Packages, __init__.py

Pythonpython

The Question

What is the difference between modules and packages? What does __init__.py do?

What a Strong Answer Covers

  • module = file
  • "package = directory
  • "__init__ runs on import

Related Questions

  • GIL — What It Is and What It Protects
  • ThreadPoolExecutor & ProcessPoolExecutor
  • Decorators — Under the Hood
  • Generators & yield
  • Context Managers

Practice This Question

Get AI-graded feedback on your answer with follow-up probes on weak points.

Take the Free Assessment
GrindQuestionsAITechnical interview assessment
TermsPrivacyAbout