What is the output of print(bool('0')) in Python?
print(bool('0'))
Correct answer
B. True
5 views
B. True
5 views
Any non-empty string is truthy, even the string '0'.
Asked in: Python Interview Data Types
https://docs.python.org/3/library/stdtypes.htmlNot sure why the answer is B? Ask here and get an explanation.