TGViewer
Coding Interview Preparation Coding Interview Preparation @coding_interview_preparation · 5.9K subscribers
Post #1398 301
🔍 GUESS THE OUTPUT #5 - full breakdown

python
print(bool("False"))
print(bool(""))
print(bool([False]))
print(bool(0.0))


Answers:

True
False
True
False


Breakdown:
1️⃣ "False" is a non-empty string - any non-empty string is truthy, REGARDLESS of its content. The string literally saying "False" doesn't matter.
2️⃣ "" is an empty string - falsy.
3️⃣ [False] is a list containing one element - and non-empty lists are always truthy, regardless of what's inside them.
4️⃣ 0.0 is falsy, just like 0.

This one trips up even experienced developers because #1 and #3 look like they "should" be False at a glance, but Python's truthiness rules only care about emptiness/zero-ness of the container itself, never its contents.

Which one did you get wrong, if any? Be honest 😄
More from @coding_interview_preparation
  1. Oct 8, 2026If you're prepping for system design interviews, this repo is gold It contains a curated,…
  2. Oct 6, 2026document post
  3. Oct 4, 2026💼 Why Your Resume Gets Rejected Before a Human Reads It You may have good skills and proj…
  4. Oct 2, 2026🧠 Coding Myths You Should Stop Believing There's a lot of advice online about learning to…
  5. Oct 1, 2026Most Asked Topics in AI Engineer Interviews Based on 2026 candidate reports
  6. Sep 30, 2026💼 What Companies Actually Look For in a Fresher Think companies only care about your CGPA…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →