practicepython.in
python exercises
171 exercises

Daily #28 · 26 October 2026

Is 1 in there? Easy

What does this print?

print(1 in {"one": 1})
  1. AFalse
  2. BTrue
  3. C1
  4. Draises TypeError
Show the answer

A: False

Why: in on a dict checks the keys. To look among the values, ask 1 in d.values() — which reads every value, so it is slow on big dicts.

Play today’s puzzle →