[Tutor] using 'and ' and 'or' with integers
Andreas Perstinger
andipersti at gmail.com
Wed Jan 9 08:36:31 CET 2013
[Please don't send HTML to this list. Just use plain text]
On 09.01.2013 07:56, ken brockman wrote:
> I was looking through some lab material from a computer course
> offered at UC Berkeley and came across some examples in the form of
> questions on a test about python. 1 and 2 and 3 answer 3 I've goggled
> it till i was red in the fingers, but to no avail.. Could someone be
> kind enuff to direct me to some docs that explain this??
Language Reference - 6.10 Boolean operations (for Python 3.3; it's 5.10
for Python 2.7):
http://docs.python.org/3.3/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."
Bye, Andreas
More information about the Tutor
mailing list