1. Home
  2. Data Science
  3. Python
  4. What are type hints in Python?

Added 25 Nov 2026

What are type hints in Python?

  1. Mandatory runtime type checks
  2. Optional annotations indicating expected types Correct answer
  3. A compiler directive
  4. A kind of comment that is executed

Correct answer

B. Optional annotations indicating expected types

5 views

MCQSEXAM

Explanation

Type hints are not enforced at runtime but help tools like mypy and IDEs.

Reference

Asked in: Python Interview Functions

https://docs.python.org/3/tutorial/controlflow.html#defining-functions

Preparing for an exam?

Doubts & discussion

Not sure why the answer is B? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs