ICT Ezy <
[email protected]> writes:
Please explain how to generate different output in following logical operations
0 and True
0
0 or True
True
1 and True
True
1 or True
1
I call a value "x" "falsy" if "not not x" evaluates to "False";
I call a value "x" "truthy" if "not not x" evaluates to "True".
The evaluation of "x and y" first evaluates "x";
If the value of "x" is falsy, then the value of "x" becomes
the value of "x and y",
otherwise, "y" is being evaluated, and the value of "y" becomes
the value of "x and y".
The evaluation of "x or y" first evaluates "x";
If the value of "x" is truthy, then the value of "x" becomes
the value of "x and y",
otherwise, y is being evaluated, and the value of "y" becomes
the value of "x and y".
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)