Empty string is False right?

Vlastimil Brom vlastimil.brom at gmail.com
Sat Jan 31 07:27:14 EST 2009


2009/1/31 AJ Ostergaard <aj at cubbyhole.net>:
> Hi Ralf,
>
> Thanks for that but why:
>
>>>> '' and True
> ''
>
> Surely that should be False?!?
>
> Regards,
> AJ
>
>
see the docs:
http://docs.python.org/reference/expressions.html#boolean-operations

"The expression x and y first evaluates x; if x is false, its value is
returned; otherwise, y is evaluated and the resulting value is
returned."

hth,
  vbr



More information about the Python-list mailing list