Wednesday, September 29, 2010

'and' and 'or' operator as Short-Circuiting Operators

x and y first evaluates x. If x is false, the result is x ; otherwise, the result is y.
x or y first evaluates x. If x is true, the result is x ; otherwise, the result is y .

and and or don't force their results to be True or False, but rather return one or the other of their operands.

No comments:

Post a Comment