Page 109 - Information_Practice_Fliipbook_Class11
P. 109

V1 = value * 2
                  M2 = message + '2'
                  V2 = value + 2
                  print(M1,   M2,   sep = '##')
                  print(V1,  V2,  sep = '@@')
             Ans.  Be SimpleBe Simple##Be Simple2
                  50@@27




                                                     Assessment



            A.  Multiple Choice questions
               1.  Which of the following statements will result in an error?
                  a.  number = 07          b. number = 70         c. number = '07'      d. number = '70'

               2.  Which of the following is a hexadecimal number?
                  a.  x0123                b. 0x123               c. 123x0              d. 1230x
               3.  Which of the following is equivalent to 1E2?
                  a.  100.0                b. 10.0                c. 1.0                d. 1000.0
               4.  Which of the following is NOT a sequence data type?
                  a.  String               b. Tuple               c. Dictionary         d. List
               5.  Which of the following pair of  symbols is used to enclose values in a tuple?
                  a.  []                   b. {}                  c. <>                 d. ()
               6.  Which of the following data types does not support operatiors?
                  a.  Set                  b. None                c. Dictionary         d. List
               7.  Which of the following operators has the highest precedence?
                  a.  +                    b. %                   c. or                 d. =
               8.  Which of the following statements  makes use of typecasting?
                  a.  num = 10.7 + 40.6    b. num = 3+4j          c. num = 10.7 + 40    d. num = 3 + 4
               9.  Which of the following statements will result in a syntax error?
                  a.  num = int(input('Enter a number'))          b. num = input('Enter a number')
                  c.  num = input(int('Enter a number'))          d. num = float(input('Enter a string'))
              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.                                                                __________





                                                                                        Data Types and Operators  95
   104   105   106   107   108   109   110   111   112   113   114