Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up

What is the purpose of the __init__.py file in a package?

  1. A To mark a directory as a package and optionally run package initialisation code
  2. B To define the main entry point
  3. C To list dependencies
  4. 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.

All Python MCQs

Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up as