Page 58 - Computer - 7
P. 58

5.  Differentiate between:
                  (a)  Division operator and Modulus operator
                  (b)  Division operator and Floor division operator
                  (c)  The Arithmetic + operator and the String + operator
              6.  Explain the three Logical operators in Python with an example of each.
              7.  Explain the functions in Python used to convert one data type to another.
                                                                                                   Computational Skills
            Mind Stretching
            1.  Evaluate and write the output of the following Python statements:
                 (a) (True and False) or (True and True)

                 (b) print(“Hello” * 3)
                 (c) print(“the result of 26//4 is ”, 26 // 4)
                 (d) 80 – (25 / 5 * 10 + (3 ** 3))
            2.  Write the output of the following code segments in Python:

                 (a)  X = 20                                    (b) num1 = 20

                     X *= 10                                      num2 = 30
                     print(X)                                       num3 = 40
                                                                  print(num1 + num2 + num3 / 4)
                 (c)  String1 = “I”
                     String2 = “Love”
                     String3 = “Python”

                     # print(“Displaying values”)
                     print(String1 + String2 + String3)


             Lab Work                                                                              Computational Skills



              Write the following programs in Python:
                (a)  Program to accept the length and breadth of a rectangle from the user and display its area and
                    perimeter.
                (b)  Program to accept distance from the user in metres and convert it into kilometres and metres.
                (c)  Program to accept three numbers from the user and display their sum and product.
                (d)  Program to accept the three sides of a triangle from the user and display its perimeter.
                (e)  Program to accept a number from the user and display its square and cube using operators.

            DISCUSS
            DISCUSS                                                                                Communication Skills
             Is the use of operators in Python easy and natural to understand? Discuss with your classmates.


           TEACHER’S DESK
           TEACHER’S DESK
           Explain,  with  illustrations,  the  various  operators  used  in  Python  to  the  students.  Emphasize  the  order  of
           precedence to follow while evaluating expressions containing more than one operator.


               56
   53   54   55   56   57   58   59   60   61   62   63