Test Your Knowledge: Quiz

  1. What is the purpose of an __init__.py file in a module package directory?

  2. How can you avoid repeating the full package path every time you reference a package’s content?

  3. Which directories require __init__.py files?

  4. When must you use import instead of from with packages?

  5. What is the difference between from mypkg import spam and from . import spam?

  6. What is a namespace package?