This is actually very well described in most tutorials; the general rule is: a and b
is b
if a
is true, else it is a
; a or b
is a
if a
is true, else it is b
. Now, False
, None
, ()
, []
, {}
, ''
, 0
and 0.0
are all considered false; practically everything else is true.
solved Understanding and, or operations in Python [duplicate]