On Fri, Apr 24, 2015 at 8:50 AM, <[email protected]> wrote:
> Dear Group,
>
> I am trying to understand the use of Boolean operator in Python. I am trying
> to
> write small piece of script, as follows,
>
> def input_test():
> str1=raw_input("PRINT QUERY:")
> if "AND" or "OR" or "NOT" in str1:
This is equivalent to:
if ("AND") or ("OR") or ("NOT" in str1):
Which is always true because the truth value of the literal strings
"AND" and "OR" are true.
It is not equivalent to:
if ("AND" in str1) or ("OR" in str1) or ("NOT" in str1):
--
https://mail.python.org/mailman/listinfo/python-list