Question 5
Back to Exercise
What is the output of the following Python program?
print(bool(""), bool(" "), bool(0.0), bool([]), bool("False"), bool([0]))
- A False False False False False False
- B False True False False False True
- C False True False False True True Correct
- D True True False False True False
Correct Answer: Option C
Only empty and zero values are falsy. " ", "False" and [0] are all non-empty, so they are truthy.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!