practicepython.in
python exercises
171 exercises

Daily #9 · 7 October 2026

True arithmetic Easy

What does this print?

print(True + True + True)
  1. Araises TypeError
  2. BTrue
  3. C3
  4. DTrueTrueTrue
Show the answer

C: 3

Why: bool is a subclass of int: True is 1 and False is 0. That is why sum(x > 0 for x in nums) counts the positives.

Play today’s puzzle →