the logical operation confused me

Terry Reedy tjreedy at udel.edu
Thu Apr 10 19:09:29 EDT 2014


On 4/10/2014 7:02 PM, length power wrote:
>  >>> "ok" or "not ok"
> 'ok'
>  >>> "ok" and "not ok"
> 'not ok'
>  >>>
>
> why "ok" or "not ok" output "ok"  , "ok" and "not ok"  output "not ok" ?

This is explained in our fine manual.
https://docs.python.org/2/reference/expressions.html#boolean-operations

-- 
Terry Jan Reedy




More information about the Python-list mailing list