0
Why?
print( bool('0==1') ) This gives True, which is counterintuitive to me. 0 == 1 is not True therefore it is False, isn't it?
5 Answers
+ 6
strings are always True
it means that ,
bool("wi")==True
bool("2")==True
bool("True")==True
bool("False")==True
bool("1==2")==True
only empty strings returns False
bool("")==False
hope I helped
+ 3
The string "0==1" is not 0, so it is evaluated to True.
Try print( bool(0==1)) instead.
0
strings are always True
it means that ,
bool("wi")==True
bool("2")==True
bool("True")==True
bool("False")==True
bool("1==2")==True
only empty strings returns False
bool("")==False
hope I helped
- 3
andrid@system.com
- 3
01010110110110011000