practicepython.in
python exercises
171 exercises

Daily #25 · 23 October 2026

What or returns Hard

What does this print?

print(0 or "" or "cat" and "dog")
  1. Adog
  2. BTrue
  3. C0
  4. Dcat
Show the answer

A: dog

Why: and binds tighter than or, and both return one of their operands, not True or False. "cat" and "dog" is "dog"; 0 and "" are falsy, so or moves past them.

Play today’s puzzle →