Page 91 - ThinkGPT_V2.1_C7_Flipbook
P. 91

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

                      >       Greater      It checks whether the value of the left operand  x > y           True
                              than         is greater than the value of the right operand.
                                           If it is, the condition evaluates to true.

                      <       Less than    It checks whether the value of the left operand  x < y           False
                                           is less than the value of the right operand. If it
                                           is, the condition evaluates to true.

                      >=      Greater      It checks whether the value of the left operand  x >= y          True
                              than or      is greater than or equal to the value of the right
                              equal to     operand. If it is, the condition evaluates to true.

                      <=      Less than    It checks whether the value of the left operand  x <= y          False
                              or equal to  is less than or equal  to  the value  of  the right
                                           operand. If it is, the condition evaluates to true.


                 Program: To show all the relational operators’ functions.



























                 On running the above program, you will get the following output:






















                                                                                            More on Python    89
   86   87   88   89   90   91   92   93   94   95   96