What is the purpose of the __init__.py file in a package?
- A To mark a directory as a package and optionally run package initialisation code
- B To define the main entry point
- C To list dependencies
- D To store configuration
Answer
To mark a directory as a package and optionally run package initialisation code
It is commonly used to expose a curated public API by importing selected names from submodules.





