1. Home
  2. Data Science
  3. Python
  4. Which of the following statements about booleans in Python…

Added 4 May 2024

Which of the following statements about booleans in Python is true?

  1. Booleans are represented as 1 and 2.
  2. Booleans can only be assigned with the True keyword.
  3. Booleans are a subclass of integers. Correct answer
  4. Booleans cannot be used in conditional statements.

Correct answer

C. Booleans are a subclass of integers.

13 views

MCQSEXAM

Explanation

In Python, booleans are a subclass of integers, and True and False are instances of the bool class.

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