Boolean Context - University of Texas at Austin
Boolean values are a useful way to refer to the answer to a yes/no question. The Boolean constants are the values: True, False. A Boolean expression evaluates to a Boolean value. Boolean Context In a Boolean context |one that expects a Boolean value|False, 0, "" (the empty string), and None all stand for False and any other value stands for True.
python cast bool to int