Join waitlist
GeneralCommunity question

today's daily Q7 answer is wrong?

Asked by Neha Joshi 25 days ago 2 answers 3 votes

the one about the output of print(bool("False")). I said False, it says True. is the answer key wrong?

2 answers

Arjun Mehta24 days agoMost voted5

answer is right. "False" is a non empty string, and any non empty string is truthy. bool("") is the only string that gives False

Neha Joshi24 days ago2

omg I read it as the boolean False. ok my bad 🤦‍♀️

Related questions

Go deeper

Want the full explanation, not just an answer?

Structured lessons on DSA, core CS, Java and interview skills, each ending in a quiz so you know it stuck.