On 04/10/2014 04: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" ?
You are probably confusing yourself with the string "not ok". That
string, and any other non-empty string is considered true
>>> bool("not ok")
True
>>> bool("ok")
True
perhaps you meant
>>> not "ok"
False
Once past that possible confusion, the return value of the *and* and
*or* operators are explained here:
https://docs.python.org/release/2.5.2/lib/boolean.html
Gary Herron
--
https://mail.python.org/mailman/listinfo/python-list