1. Home
  2. Data Science
  3. Python
  4. What does isinstance(True, int) return in Python?

Added 2 Nov 2026

What does isinstance(True, int) return in Python?

  1. None
  2. TypeError
  3. False
  4. True Correct answer

Correct answer

D. True

24 views

MCQSEXAM

Explanation

bool is a subclass of int in Python (True == 1 and False == 0), so the check passes. This surprises many developers when validating inputs.

Reference

Asked in: NTS, Python Developer Interviews

Preparing for an exam?

Doubts & discussion

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