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

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)
              14.  Write a program repeatString to accept a string (str) and a number, n. The program should display the string n
                  number of times.
              15.  Differentiate between logical errors and runtime errors.
              16.  What is the value of the expression 150 / 5?
              17.  What is the value of the expression 90 // 4?
              18.  Is 'None' the same as None? Justify your answer.
              19.  What value will the expression bool(False) yield?
              20.  What value will the expression bool(7) yield?
              21.  What will be the output produced on  evaluating the following expressions?
                    (i)  bool(0)
                   (ii)  22 % 5 is 20 % 5
                  (iii)  78 / 12.3 ==  78 // 12.3
                  (iv)  78 // 12.3 == int(78 // 12.3)
                   (v)  56 % 5.0
              22.  What will be output produced on the execution of the following code?
                  p = 3/4 + 2
                  q = int(3/4 + 2)
                  r = 5 + int(5 / 2)
                  s = 5 + 3.0 / 2
                  t = int(5 + 4 / 6.0)
                  print(p, q, r, s, t)
              23.  Why are logical errors hard to locate?
              24.  Write a program to accept the length, breadth, and height of a parallelogram and display its area and perimeter.


                   Assertion and Reasoning Based Questions


                  The following questions are assertion(A) and reasoning(R) based. Mark the correct choice as
                  (a) Both A and R are true and R is the correct explanation of A
                  (b) Both A and R are true and R is not the correct explanation of A
                  (c) A is true but R is false
                  (d) A is false but R is true

               1.  Assertion(A):  Python allows scientific notation to express floating point numbers.
                  Reasoning(R):  45E02 is equivalent to 45.00
               2.  Assertion(A):  The first element of a list is at  index 0.
                  Reasoning(R):  A list is an ordered data type.



                                                                                        Data Types and Operators  175
   172   173   174   175   176   177   178   179   180   181   182