Page 43 - Code & Click - 7
P. 43

P
             Post-Processingost-Processing
                Python  is  an  interpreted,  object-oriented,  high-level  programming  language  for  general-
                  purpose programming.
                Variables are named locations in the memory of a computer where data is stored temporarily.
                Common data types used in Python are Integer, Float, String, and Boolean.
                Python provides int( ), float( ), and str( ) functions to convert one type of data into another.
                Operators are special symbols that are used to perform a mathematical operation or logical
                  computation.
                Operators available in Python can be categorised as Arithmetic, Assignment, Relational,
                  Logical, and String operators.




                                                        Info Retention
            A.   Select the correct option for each of the following statements.

                1.   In Python, the output of the expression 24 % 3 will be ______.
                    (a)  8                  (b)  0                    (c)  24                 (d)  3

                2.  The operators that combine two expressions involving relational operators are ______.
                    (a)  Logical            (b)  String               (c)  Arithmetic         (d)  Assignment
                3.  If the value of a variable Num is 25, what will be its value after the statement Num *= 4 is
                    executed?

                    (a)  29                 (b)  21                   (c)  100                (d)  6.25
                4.  Which of the following operators has the highest precedence?

                    (a)  Subtraction        (b)  Division             (c)  Multiplication     (d)  Exponentiation
            B.  Fill in the blanks with the correct answer.

                1.  The _________ operator repeats a string a specified number of times.
                2.  The _________ logical operator reverses the value of an expression.

                3.  The _________ function is used to convert a string data into its corresponding integer value.
                4.  The _________ data type stores the values True and False.

            C.  Write ‘T’ for True and ‘F’ for False statement.
                1.  The Concatenation operator is used to add two numeric values.                          _______

                2.  Arithmetic calculations can be performed on float data.                                _______
                3.  The input( ) function treats all data as string.                                       _______
                4.  The Logical operator OR returns the value False if any one of the expressions
                    evaluates to True.                                                                     _______

            D.  Answer the following questions.
                1.  What are operators? Describe the different types of operators used in Python.

                2.  What is a data type? Explain the common data types available in Python with an example of
                    each.


                                                                                                                 41
   38   39   40   41   42   43   44   45   46   47   48