practicepython.in
python exercises
171 exercises

Daily #38 · 5 November 2026

Empty, but not False Medium

What does this print?

print("" == False, not "")
  1. AFalse True
  2. BTrue True
  3. CFalse False
  4. DTrue False
Show the answer

A: False True

Why: An empty string is treated as false by if and not, but it is not equal to False: == compares values, and a string never equals a bool. To test for an empty string, write if not text:.

Play today’s puzzle →