all objects have an inherent boolean true or false value any nonzero number or nonempty object is true zero numbersempty objectsand the special object none are considered false comparisons and equality tests are applied recursively to data structures comparisons and equality tests return true or false (custom versions of and boolean and and or operators return true or false operand object boolean operators stop evaluating ("short circuit"as soon as result is known the if statement takes action on truth valuesbut boolean operators are used to combine the results of other tests in richer ways to produce new truth values more formallythere are three boolean expression operators in pythonx and is true if both and are true or is true if either or is true not is true if is false (the expression returns true or falseherex and may be any truth valueor any expression that returns truth value ( an equality testrange comparisonand so onboolean operators are typed out as words in python (instead of ' &&||and !alsoboolean and and or operators return true or false object in pythonnot the values true or false let' look at few examples to see how this works (truefalseless thanreturn true or false ( or magnitude comparisons such as these return true or false as their truth resultswhichas we learned in and are really just custom versions of the integers and (they print themselves differently but are otherwise the sameon the other handthe and and or operators always return an object--either the object on the left side of the operator or the object on the right if we test their results in if or other statementsthey will be as expected (rememberevery object is inherently true or false)but we won' get back simple true or false for or testspython evaluates the operand objects from left to right and returns the first one that is true moreoverpython stops at the first true operand it finds this is usually called short-circuit evaluationas determining result short-circuits (terminatesthe rest of the expression as soon as the result is known or or ( return left operand if true elsereturn right operand (true or falsetruth values and boolean tests