$ ./guess_the_languageProblem Solving — predict the output
Problem Solving — predict the output · medium · #144

What is printed?

print(bool([]), bool([0]))
  1. False True
  2. True False
  3. False False
  4. True True
Emptiness decides truthiness, so a list holding 0 is still truthy.
Play Problem Solving ▸