Page 151 - 2620_Birla Open Mind C-6
P. 151

Program 4: To show all the relational operators’ functions





















                 The result of the above program is:
















                           Interdisciplinary Learning

                           #Mathematics

                   Write a program in Python to calculate the area of a square.







                                                                                                           #Lab Activity



                      PRECEDENCE OF OPERATORS

                 Precedence of operators determines the order in which the operators are executed. When multiple
                 operators are  present  in  an  expression,  the  ones  with  higher  precedence  are evaluated  first. The
                 operator precedence in Python is listed in the given table.

                 The following table shows the precedence of operators in Python. The highest precedence is at the top.

                                       Operator                                 Name

                              ()                            Parenthesis
                              **                            Exponent

                              *, /, %, //                   Multiplication, Division, Modulo, Floor Division
                              +, –                          Addition, Subtraction



                                                                                                          #Python 149
   146   147   148   149   150   151   152   153   154   155   156