appendix python review nitude while strings are compared lexicographicallycharacter by character from left to right the python relational operators are shown herea = is greater than is less than is equal to > < ! is greater than or equal to is less than or equal to is not equal to boolean operators the boolean operators are applied to boolean values they allow for the construction of not only boolean expressions but also more complex logical expressions by combining multiple relational and boolean expressions for exampleconsider the following logical expressionavg > and avg < which determines if the given value is in the range [ the python boolean operators are described nextnot and or unary operator that inverts the boolean value of its operand true if and only if both and are true true if is trueb is trueor both and are true the logical operators are evaluated from left to right based on their order of precedence which can be overridden using parentheses the relational operators have the highest precedence followed by the boolean operators in the order listed new in python xthe operatorwhich in earlier versions could be used in place of !=is no longer available object references python provides the is and is not operators for comparing referencesor the addresses stored in variables for examplein the code segmentname "smithname "jonesresult name is name result is set to false since the two variables point to two different objects if we modify the segment as followsname name result name is name result is now set to true since the two variables refer to the same object and are thus aliases the is not operator returns the inverse of the is operator and is equivalent to applying the boolean not operator for examplethe following logical expressions are equivalent