Page 176 - Computer Science Class 11 With Functions
P. 176

10.  What will be the output produced if the following expression is evaluated?
              'None' and 'hello'
              a.  'None'               b. 'hello'             c. True                d. False
        B.  State whether the following statements are True or False:
           1.  Python does not allow leading zeros.                                                    __________
           2.  A floating point number always includes a decimal point.                                __________
           3.  The last element in a sequence is always at index -1.                                   __________
           4.  A dictionary is a mutable data type.                                                    __________
           5.  A list can be modified using index values.                                              __________
           6.  A set cannot have duplicate values.                                                     __________
           7.  A pair of parenthesis is used to override the precedence of operators in an expression.   __________
           8.  If a is assigned the value 234.123456789 and b is assigned the value 234.123456789, the expression
              a is b will yield False.                                                                 __________
           9.  All unary operators in an expression are evaluated from left to right.                  __________
          10.  If an error is encountered, Python interpreter skips that statement and starts executing the next
              statement in sequence.                                                                   __________
        C.  Fill in the blanks.
           1.  The function ____________ returns the type of an object.
           2.  In  a  Boolean  expression,  Python  considers  the  numeric  value  0  as  ____________  and  a  numeric  value  other  than  0
              as ____________.
           3.  Elements of  sets and dictionaries are enclosed in ____________ brackets.
           4.  An ____________ operator is typically used for checking the data type of an object.
           5.  The function ____________ transforms the ASCII character to its ASCII code.
        D.  Answer the following questions:
           1.  Identify the data type of each of the following:
              "kilogram" , 78.3 , [90,45,23,76] , ('a', 'b')
           2.  Consider the following string:
              message = "You are late."
              What will be the output of the statements given below:
              message[2]
              message[5]

           3.  What is the difference between the two statements given below:
              t = [1, 3, 4, 5, 6,3 ,10]
              t = {1, 3, 4, 5, 6, 3, 10}
           4.  The following set of statements results in an error. Why?
              >>> days = ('sun','mon','wed')
              >>> days[2] = 'tue'
           5.  Name two mutable and two immutable data types.
           6.  Which data type is used to store textual data?
           7.  What is the difference between a tuple and a dictionary?
           8.  Simmy wants to store days of the week in a sequence data type. Which data type will you recommend?
           9.  What type of operators act on a pair of values?
          10.  Evaluate the following Python expressions, if a = 5, b = 2, and c = -2
                (i)  a + b // a
               (ii)  c * 2 ** a
              (iii)  a > b or a + c // 2 <= 0


         174   Touchpad Computer Science-XI
   171   172   173   174   175   176   177   178   179   180   181