Page 110 - Information_Practice_Fliipbook_Class11
P. 110

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 that 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
          11.  What is the difference between the following operators:
              (i)  * and **
              (ii)  =  and ==
              (iii)  relational and logical
              (iv)  \ and \\
              (v)  identity and membership

          12.  What is meant by the term expression in Python programming?
          13.  Consider the program given below. Will it be executed successfully? Why/ Why not?
              num = input("Enter a number")
              num = num - 10
              print("num =  ", num)


          96   Touchpad Informatics Practices-XI
   105   106   107   108   109   110   111   112   113   114   115