practicepython.in
python exercises
171 exercises

Daily #8 · 6 October 2026

Halving a debt Medium

What does this print?

print(-7 // 2)
  1. A-3.5
  2. B3
  3. C-3
  4. D-4
Show the answer

D: -4

Why: // rounds down, towards minus infinity, not towards zero. -3.5 rounded down is -4. int(-7 / 2) gives -3 if that is what you meant.

Play today’s puzzle →