Page 89 - Digicode_AI_class_7
P. 89

Operator    Name              Description                                              Example

                 /=      Division          It divides left operand with the right operand and          x /= 3
                         assignment        assigns the result to left operand. x/=3 is equivalent to
                                           x=x/3.

                 %=      Remainder         It takes modulus of two operands and assigns the            x %= 3
                         assignment        result to left operand. x%=3 is equivalent to x=x%3.

                //=      Floor division    It performs floor division on operators and assigns        x //= 3
                         assignment        the value to the left operand. x//=3 is equivalent to
                                           x=x//3.

                **=      Exponentiation  It performs exponential (power) calculation on               x **= 3
                         assignment        operators and assigns the value to the left operand.
                                           x**=3 is equivalent to x=x**3.

            Program: To perform all the assignment operation.

































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





















                                                                                       More on Python     87
   84   85   86   87   88   89   90   91   92   93   94