Page 116 - Touchpad_Plus_V3.2_Class 6
P. 116

Example
                   Operator      Name                       Description                                      Output
                                                                                           (x=8 and y=6)

                       !=      Not equal It checks if the values of two operands are            x != y       TRUE
                                            equal or not. If the values are not equal,
                                            then the condition becomes true.

                       >        Greater     It checks if the value of left operand is            x > y       TRUE
                                  than      greater than the value of right operand. If
                                            yes, then the condition becomes true.
                       <        Less than   It checks if the value of left operand is less       x < y       FALSE

                                            than the value of right operand. If yes, then
                                            the condition becomes true.

                      >=        Greater     It checks if the value of left operand is           x >= y       TRUE
                                 than or    greater than or equal to the value of
                                equal to    right operand. If yes, then the condition
                                            becomes true.

                      <=        Less than  It checks if the value of left operand is less       x <= y       FALSE
                               or equal to than or equal to the value of right operand.
                                            If yes, then the condition becomes true.


                  Program 4: To show all the relational operators’ functions.

                                                              Program4.py
                    File  Edit  Format   Run   Options   Window    Help

                    #Program to perform Relational Operators
                    a = 11
                    b = 32
                    #Check if a is greater than b
                    print (a > b)
                    #Check if a is less than b
                    print (a < b)
                    #Check if a is equal to b
                    print (a == b)
                    #Check if a is not equal to b
                    print (a != b)
                    #Check if a is greater than equal to b
                    print (a >= b)
                    #Check if a is ess than equal to b
                    print (a <= b)







               114      Plus (Ver. 3.2)-VI
   111   112   113   114   115   116   117   118   119   120   121