when you use an expression to determine true or false valuetrueany nonzero numbernonempty stringlisttupleor dictionary is taken to be true falsezerononeand empty liststuplesand dictionaries evaluate as false boolean expressions are evaluated from left to right and consume the right operand only if it' needed to determine the final value for examplea and evaluates only if is true this is sometimes known as "short-circuitevaluation object equality and identity the equality operator ( =ytests the values of and for equality in the case of lists and tuplesall the elements are compared and evaluated as true if they're of equal value for dictionariesa true value is returned only if and have the same set of keys and all the objects with the same key have equal values two sets are equal if they have the same elementswhich are compared using equality (==the identity operators ( is and is not ytest two objects to see whether they refer to the same object in memory in generalit may be the case that =ybut is not comparison between objects of noncompatible typessuch as file and floatingpoint numbermay be allowedbut the outcome is arbitrary and may not make any sense it may also result in an exception depending on the type order of evaluation table lists the order of operation (precedence rulesfor python operators all operators except the power (**operator are evaluated from left to right and are listed in the table from highest to lowest precedence that isoperators listed first in the table are evaluated before operators listed later (note that operators included together within subsectionssuch as yx yx yand yhave equal precedence table order of evaluation (highest to lowestoperator name )] [ ] [ :js attr + - ~ * yx yx /yx yx tuplelistand dictionary creation indexing and slicing attributes function calls unary operators power (right associativemultiplicationdivisionfloor divisionmodulo additionsubtraction bit-shifting bitwise and bitwise exclusive or bitwise or comparisonidentityand sequence membership tests yx <yx yx >yx =yx ! lib fl ff