0

What is the output of the below code in Python?

a='0' print(bool(a))

15th Aug 2017, 2:45 PM
ASUTOSH BISWAL
ASUTOSH BISWAL - avatar
4 Answers
0
the only string that evaluates as False is the empty string. So the output is True
15th Aug 2017, 3:38 PM
Amaras A
Amaras A - avatar
0
false
15th Aug 2017, 2:46 PM
Joshua
Joshua - avatar
- 1
if you do this... a='0' print(not bool(a)) the only the output is false
15th Aug 2017, 2:50 PM
sayan chandra
sayan chandra - avatar
- 1
here is the extra-modified code with all possible explaination of bool command check it out... https://code.sololearn.com/cChMpVIKcJsS/?ref=app
15th Aug 2017, 4:05 PM
sayan chandra
sayan chandra - avatar