bool([ ]true the result looks pretty strangebut there is fairly short general explanationalmost everything is converted to true the only values among built-in types that are interpreted as false are the boolean value false itself any numerical value equal to ( but not or - the special value none any empty sequence or collectionincluding the empty string (''but not ' or 'hior 'false'and the including empty list ([]but not [ , or [ ] possibly useful consequence occurs in the fairly common situation where something needs to be done with list only if it is nonempty in this case the explicit syntaxif len(alist dosomethingwith(alistcan be written with the more succinct pythonic idiom if alistdosomethingwith(alistthis automatic conversion can also lead to extra troublesuppose you prompt the user for the answer to yes/no questionand want to accept 'yor 'yesas indicating true you might write the following incorrect code read itans input('is this ok'if ans ='yor 'yes'print('yesit is ok'the problem is that there are two binary operations here==or comparison operations all have higher precedence than the logical operations orandand not the if condition above can be rewritten equivalently with parentheses read and consider(ans =' 'or 'yesother programming languages have the advantage of stopping with an error at such an expressionsince string like 'yesis not of type bool pythonhoweveraccepts the expressionand treats 'yesas true to testrun the example program boolconfusion pyshown belowans 'yif ans ='yor 'yes'print(' is ok'ans 'noif ans ='yor 'yes'print('no is ok!!???'python detects no error the or expression is treated as truesince 'yesis non-empty sequenceinterpreted as true the intention of someone writing if ans ='yor 'yes'presumably was that the condition meant something like (ans =' 'or (ans ='yes' arbitrary types treated as boolean