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 type hints in Python?

  1. A They enforce types at runtime
  2. B They document intent and enable static checkers such as mypy to catch errors before execution
  3. C They speed up execution
  4. D They are required in Python 3
Answer

They document intent and enable static checkers such as mypy to catch errors before execution

Python does not enforce annotations at runtime. Their value comes from static analysis and improved editor support.

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