practicepython.in
python exercises
171 exercises

Daily #26 · 24 October 2026

Three items, how many left? Hard

What does this print?

print(len({1, 1.0, True}))
  1. A1
  2. B2
  3. Craises TypeError
  4. D3
Show the answer

A: 1

Why: A set keeps one of each equal value, and 1 == 1.0 == True. It is the same rule that squeezed three dict keys into one.

Play today’s puzzle →