Page 171 - Computer Science Class 11 Without Functions
P. 171

Solved Exercise


            A.  Multiple Choice Questions
               1.  Which of the following are NOT numeric data types in Python?
                  a.  str                  b. int                 c. Float              d. complex

               2.  Which of the following is a mutable data type?
                  a.  str                  b. int                 c. list               d. tuple

               3.  Which of the following can be the value of a bool data type?
                  a.  TRUE                 b. true                c. True               d. Truth

               4.  Which of the following denotes a mapping?
                  a.  list                 b. set                 c. tuple              d. dict
               5.  In a dictionary, which operator separates the key from its value?
                  a.  :                    b. ;                   c. ,                  d. '

               6.  Which of the following operators has the highest precedence?
                  a.  *                    b. **                  c. /                  d. //

               7.  Which of the following is NOT True about syntax errors?
                  a.  A syntax error is a mistake in applying the rules of a programming language.
                  b.  When a syntax error is encountered, Python interpreter stops execution of the program.
                  c.  A syntax error will be generated, if the user enters a string instead of a number.
                  d.  When a syntax error is encountered, the interpreter displays the type of error along with the error message.
               8.  Which of the following is the correct  characteristic of a logical operator?
                  a.  It yields either True or False.
                  b.  It compares two values.
                  c.  It checks for a value in a sequence.
                  d.  There are only two logical operators.

            B.  State whether the following statements are True or False:
               1.  Literals of type int may be positive or negative.                                      __________
               2. id() is used to determine the type of a data object.                                    __________
               3.  Arithmetic operations cannot be performed on a string.                                 __________
               4.  The data items in a list have to be of the same data type.                             __________
               5.  A tuple is enclosed in square brackets.                                                __________
               6.  A dictionary does not allow repeated keys.                                             __________
               7.  The value None denotes False.                                                          __________
               8.  The unary operators have lower precedence than binary operators.                       __________
               9.  While executing a Python program, the statement with a syntax error is skipped and the next
                  statement is executed.                                                                  __________
              10.  A program with a logical error will not give any output.                               __________
            C.  Fill in the blanks.
               1.  We can perform arithmetic operations on _____________types of data.
               2.  A ______________ number is a combination of real and imaginary numbers.
               3.  An expression which evaluates as True  or False is a ___________expression.
               4.  The index zero denotes the __________ element in a sequence.
               5.  A _________________operator is used to compare the values of operands on either side.
               6.  An _________________in Python is a valid combination of objects and operators.



                                                                                        Data Types and Operators  169
   166   167   168   169   170   171   172   173   174   175   176