What is the difference between a module and a package in Python?
- A A module is a single .py file; a package is a directory of modules
- B A package is a single file
- C They are the same
- D A module cannot be imported
Answer
A module is a single .py file; a package is a directory of modules
A package is a directory, historically containing __init__.py. Namespace packages since Python 3.3 no longer require that file.





