1. Home
  2. Data Science
  3. Python
  4. What does int | None mean in a type hint (Python 3.10+)?

Added 25 Nov 2026

What does int | None mean in a type hint (Python 3.10+)?

  1. Bitwise or
  2. A syntax error
  3. Either an int or None Correct answer
  4. An integer subclass

Correct answer

C. Either an int or None

6 views

MCQSEXAM

Explanation

The | operator is a concise union syntax in type hints.

Reference

Asked in: Python Interview Advanced

https://docs.python.org/3/library/index.html

Preparing for an exam?

Doubts & discussion

Not sure why the answer is C? 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