Page 198 - Ai Book - 10
P. 198

u   Not Equal to (!=): This operator returns true if both the values are different.
                Example:







                  Knowledge Botwledge Bot
                  Kno
              The ASCII value of capital letters A-Z is 65 to 90, small letters is 97 to 122 and numbers 0 to 9 is 48 to
              57.

            Logical Operators

            Logical Operators are used to combine two or more conditional statements and evaluates to True or False based
            on the outcome of the conditions. In Python, the three logical operators are as follows:

             u   And Operator: The AND operator evaluates to true if both of its operands evaluate to true, otherwise False.
                Example:








                Here, ‘and’ operator evaluates to false because the ‘and’ operator will check the second condition only if
                the first condition is true.

             u   Or Operator: The OR operator evaluates to true if any one condition is true. Note that this operator will
                check the second condition only if the first condition is false.

                Example:







             u   Not Operator: The NOT operator is used to invert a value, i.e, True into False or False into true.
                Example:





                Here, not(50>20) evaluates to true because the expression 50>20 is true.

            Assignment Operator

            Assignment operator is used to assign a value specified on the RHS to the variable on the left-hand side of
            assignment operator. For example,
            a=5
            b=6






                72
                72
   193   194   195   196   197   198   199   200   201   202   203