1. Home
  2. Data Science
  3. Python
  4. What is the output of print(0 or 0) in Python?

Added 25 Nov 2026

What is the output of print(0 or 0) in Python?

print(0 or 0)
  1. None
  2. 0 Correct answer
  3. False
  4. Error

Correct answer

B. 0

MCQSEXAM

Explanation

`or` returns the first truthy operand, otherwise the last operand; both are falsy here so the last 0 is returned.

Reference

Asked in: Python Interview Control Flow

https://docs.python.org/3/tutorial/controlflow.html

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